package com.lineage.server.model.Instance;

import com.add.L1PcUnlock;
import com.add.NewAutoPractice;
import com.eric.gui.J_Main;
import com.lineage.config.Config;
import com.lineage.config.ConfigAlt;
import com.lineage.config.ConfigDragonKnightSkill;
import com.lineage.config.ConfigGuaji;
import com.lineage.config.ConfigIllusionstSkill;
import com.lineage.config.ConfigKill;
import com.lineage.config.ConfigKnightSkill;
import com.lineage.config.ConfigOther;
import com.lineage.config.ConfigRate;
import com.lineage.data.event.Addskill;
import com.lineage.data.event.CampSet;
import com.lineage.data.event.OnlineGiftSet;
import com.lineage.data.event.ProtectorSet;
import com.lineage.data.event.lvgiveitemcount;
import com.lineage.data.event.prestigtable;
import com.lineage.data.event.taketreasure;
import com.lineage.data.quest.Chapter01R;
import com.lineage.echo.ClientExecutor;
import com.lineage.echo.EncryptExecutor;
import com.lineage.server.clientpackets.AcceleratorChecker;
import com.lineage.server.datatables.AutoAddSkillTable;
import com.lineage.server.datatables.C1_Name_Type_Table;
import com.lineage.server.datatables.ExpTable;
import com.lineage.server.datatables.ExtraMeteAbilityTable;
import com.lineage.server.datatables.ItemTable;
import com.lineage.server.datatables.ItemVIPTable;
import com.lineage.server.datatables.ItemdropdeadTable;
import com.lineage.server.datatables.MapLevelTable;
import com.lineage.server.datatables.MapsTable;
import com.lineage.server.datatables.NpcTable;
import com.lineage.server.datatables.RecordTable;
import com.lineage.server.datatables.RewardPrestigeTable;
import com.lineage.server.datatables.SkillsTable;
import com.lineage.server.datatables.Taketreasure;
import com.lineage.server.datatables.lock.CharBuffReading;
import com.lineage.server.datatables.lock.CharMapTimeReading;
import com.lineage.server.datatables.lock.CharOtherReading;
import com.lineage.server.datatables.lock.CharOtherReading1;
import com.lineage.server.datatables.lock.CharOtherReading2;
import com.lineage.server.datatables.lock.CharOtherReading3;
import com.lineage.server.datatables.lock.CharSkillReading;
import com.lineage.server.datatables.lock.PetReading;
import com.lineage.server.datatables.sql.CharacterTable;
import com.lineage.server.model.L1ActionPc;
import com.lineage.server.model.L1ActionPet;
import com.lineage.server.model.L1ActionSummon;
import com.lineage.server.model.L1Apprentice;
import com.lineage.server.model.L1AttackPc;
import com.lineage.server.model.L1CastleLocation;
import com.lineage.server.model.L1Character;
import com.lineage.server.model.L1ChatParty;
import com.lineage.server.model.L1Clan;
import com.lineage.server.model.L1DwarfForChaInventory;
import com.lineage.server.model.L1DwarfForElfInventory;
import com.lineage.server.model.L1DwarfInventory;
import com.lineage.server.model.L1EquipmentSlot;
import com.lineage.server.model.L1ExcludingList;
import com.lineage.server.model.L1HateList;
import com.lineage.server.model.L1Inventory;
import com.lineage.server.model.L1Karma;
import com.lineage.server.model.L1Object;
import com.lineage.server.model.L1Party;
import com.lineage.server.model.L1PcInventory;
import com.lineage.server.model.L1PcQuest;
import com.lineage.server.model.L1PcRewardPrestigeGfxTimer;
import com.lineage.server.model.L1PinkName;
import com.lineage.server.model.L1Teleport;
import com.lineage.server.model.L1TownLocation;
import com.lineage.server.model.L1War;
import com.lineage.server.model.SoulTower.SoulTowerThread;
import com.lineage.server.model.classes.L1ClassFeature;
import com.lineage.server.model.monitor.L1PcInvisDelay;
import com.lineage.server.model.monitor.L1PcMonitor;
import com.lineage.server.model.monitor.PcAttackThread;
import com.lineage.server.model.skill.L1SkillUse;
import com.lineage.server.serverpackets.S_BlueMessage;
import com.lineage.server.serverpackets.S_Bonusstats;
import com.lineage.server.serverpackets.S_ChangeName;
import com.lineage.server.serverpackets.S_ChangeShape;
import com.lineage.server.serverpackets.S_DelSkill;
import com.lineage.server.serverpackets.S_DoActionGFX;
import com.lineage.server.serverpackets.S_DoActionShop;
import com.lineage.server.serverpackets.S_Exp;
import com.lineage.server.serverpackets.S_Fishing;
import com.lineage.server.serverpackets.S_HPMeter;
import com.lineage.server.serverpackets.S_HPUpdate;
import com.lineage.server.serverpackets.S_Invis;
import com.lineage.server.serverpackets.S_Karma;
import com.lineage.server.serverpackets.S_Lawful;
import com.lineage.server.serverpackets.S_Liquor;
import com.lineage.server.serverpackets.S_MPUpdate;
import com.lineage.server.serverpackets.S_MoveCharPacket;
import com.lineage.server.serverpackets.S_NPCTalkReturn;
import com.lineage.server.serverpackets.S_OtherCharPacks;
import com.lineage.server.serverpackets.S_OwnCharAttrDef;
import com.lineage.server.serverpackets.S_OwnCharPack;
import com.lineage.server.serverpackets.S_OwnCharStatus;
import com.lineage.server.serverpackets.S_PacketBox;
import com.lineage.server.serverpackets.S_PacketBoxParty;
import com.lineage.server.serverpackets.S_PacketBoxProtection;
import com.lineage.server.serverpackets.S_Poison;
import com.lineage.server.serverpackets.S_RemoveObject;
import com.lineage.server.serverpackets.S_SPMR;
import com.lineage.server.serverpackets.S_ServerMessage;
import com.lineage.server.serverpackets.S_SkillSound;
import com.lineage.server.serverpackets.S_SystemMessage;
import com.lineage.server.serverpackets.ServerBasePacket;
import com.lineage.server.templates.L1Item;
import com.lineage.server.templates.L1ItemPower_text;
import com.lineage.server.templates.L1MeteAbility;
import com.lineage.server.templates.L1Name_Power;
import com.lineage.server.templates.L1Npc;
import com.lineage.server.templates.L1PcOther;
import com.lineage.server.templates.L1PcOther1;
import com.lineage.server.templates.L1PcOther2;
import com.lineage.server.templates.L1PcOther3;
import com.lineage.server.templates.L1PcOtherList;
import com.lineage.server.templates.L1Pet;
import com.lineage.server.templates.L1PrivateShopBuyList;
import com.lineage.server.templates.L1PrivateShopSellList;
import com.lineage.server.templates.L1Skills;
import com.lineage.server.templates.L1Taketreasure;
import com.lineage.server.templates.L1TradeItem;
import com.lineage.server.templates.L1User_Power;
import com.lineage.server.thread.GeneralThreadPool;
import com.lineage.server.timecontroller.pc.MapTimerThread;
import com.lineage.server.timecontroller.server.ServerUseMapTimer;
import com.lineage.server.timecontroller.server.ServerWarExecutor;
import com.lineage.server.types.Point;
import com.lineage.server.utils.CalcInitHpMp;
import com.lineage.server.utils.CalcStat;
import com.lineage.server.utils.DoubleUtil;
import com.lineage.server.utils.L1SpawnUtil;
import com.lineage.server.utils.ListMapUtil;
import com.lineage.server.utils.RandomArrayList;
import com.lineage.server.world.World;
import com.lineage.server.world.WorldClan;
import com.lineage.server.world.WorldQuest;
import com.lineage.server.world.WorldWar;
import com.lineage.william.L1WilliamGfxIdOrginal;
import com.lineage.william.L1WilliamGfxIdOrginalpoly;
import com.lineage.william.L1WilliamLimitedReward;
import com.lineage.william.L1WilliamSystemMessage;
import com.lineage.william.Reward;
import com.lineage.william.Reward1;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ThreadLocalRandom;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class L1PcInstance extends L1Character {
  public static final int CLASSID_KNIGHT_FEMALE = 48;
  
  public static final int CLASSID_ELF_MALE = 138;
  
  public static final int CLASSID_ELF_FEMALE = 37;
  
  public static final int CLASSID_WIZARD_MALE = 734;
  
  public static final int CLASSID_WIZARD_FEMALE = 1186;
  
  public static final int CLASSID_DARK_ELF_MALE = 2786;
  
  public static final int CLASSID_DARK_ELF_FEMALE = 2796;
  
  public static final int CLASSID_PRINCE = 0;
  
  public static final int CLASSID_PRINCESS = 1;
  
  public static final int CLASSID_DRAGON_KNIGHT_MALE = 6658;
  
  public static final int CLASSID_DRAGON_KNIGHT_FEMALE = 6661;
  
  public static final int CLASSID_ILLUSIONIST_MALE = 6671;
  
  public static final int CLASSID_ILLUSIONIST_FEMALE = 6650;
  
  public static final int REGENSTATE_NONE = 4;
  
  public static final int REGENSTATE_MOVE = 2;
  
  public static final int REGENSTATE_ATTACK = 1;
  
  public static final int INTERVAL_BY_AWAKE = 4;
  
  public static final int CLASSID_KNIGHT_MALE = 61;
  
  private static final Log _log = LogFactory.getLog(L1PcInstance.class);
  
  private static final long serialVersionUID = 1L;
  
  private static final Map<Long, Double> _magicDamagerList;
  
  private static final long DELAY_INVIS = 3000L;
  
  private static final Random _random = new Random();
  
  private static final boolean _debug = Config.DEBUG;
  
  protected final L1HateList _hateList;
  
  private final Map<Integer, L1SkinInstance> _skins;
  
  private final L1Karma _karma;
  
  private final L1PcInventory _inventory;
  
  private final L1DwarfInventory _dwarf;
  
  private final L1DwarfForChaInventory _dwarfForCha;
  
  private final L1DwarfForElfInventory _dwarfForElf;
  
  private final L1ExcludingList _excludingList;
  
  private final Map<Integer, L1ItemPower_text> _allpowers;
  
  private final AcceleratorChecker _acceleratorChecker;
  
  private final L1Inventory _tradewindow;
  
  private final ArrayList<String> _attackenemy;
  
  private final ArrayList<String> _Badattackenemy;
  
  private final ArrayList<Integer> _skillList;
  
  private final ArrayList<L1PrivateShopSellList> _sellList;
  
  private final ArrayList<L1PrivateShopBuyList> _buyList;
  
  private final L1PcQuest _quest;
  
  private final L1ActionPc _action;
  
  private final L1ActionPet _actionPet;
  
  private final L1ActionSummon _actionSummon;
  
  private final L1EquipmentSlot _equipSlot;
  
  private final Object _invisTimerMonitor;
  
  private final ArrayList<L1TradeItem> _trade_items;
  
  private final int[] _doll_get;
  
  private final int _state;
  
  private final ArrayList<String> _InviteList;
  
  private final ArrayList<String> _cmalist;
  
  private final ArrayList<Integer> soulHp;
  
  private final ArrayList<Integer> _autobuff;
  
  private final ArrayList<Integer> _autoattack;
  
  public short _originalHpr;
  
  public short _originalMpr;
  
  public long _oldTime;
  
  public short _temp;
  
  public short _baseMaxMpc;
  
  public double _PartyExp;
  
  public int[] _reward_Weapon;
  
  public int ValakasStatus;
  
  public boolean _TRIPLEARROW;
  
  protected NpcMoveExecutor _pcMove;
  
  int _venom_resist;
  
  PcAttackThread attackThread;
  
  Thread _tempThread;
  
  private L1PcRewardPrestigeGfxTimer _gfxTimer4;
  
  private boolean _isKill;
  
  private short _hpr;
  
  private short _trueHpr;
  
  private short _mpr;
  
  private short _trueMpr;
  
  private boolean _mpRegenActive;
  
  private boolean _mpReductionActiveByAwake;
  
  private boolean _hpRegenActive;
  
  private int _hpRegenType;
  
  private int _hpRegenState;
  
  private int _mpRegenType;
  
  private int _mpRegenState;
  
  private int _awakeMprTime;
  
  private int _awakeSkillId;
  
  private int _old_lawful;
  
  private int _old_karma;
  
  private boolean _jl1;
  
  private boolean _jl2;
  
  private boolean _jl3;
  
  private boolean _el1;
  
  private boolean _el2;
  
  private boolean _el3;
  
  private long _old_exp;
  
  private boolean _isCHAOTIC;
  
  private L1ClassFeature _classFeature;
  
  private int _PKcount;
  
  private int _PkCountForElf;
  
  private int _clanid;
  
  private String clanname;
  
  private int _clanRank;
  
  private byte _sex;
  
  private byte[] _shopChat;
  
  private boolean _isPrivateShop;
  
  private boolean _isTradingInPrivateShop;
  
  private int _partnersPrivateShopItemCount;
  
  private EncryptExecutor _out;
  
  private int _originalEr;
  
  private ClientExecutor _netConnection;
  
  private int _classId;
  
  private int _type;
  
  private long _exp;
  
  private boolean _gm;
  
  private boolean _monitor;
  
  private boolean _gmInvis;
  
  private short _accessLevel;
  
  private int _currentWeapon;
  
  private L1ItemInstance _weapon;
  
  private L1Party _party;
  
  private L1ChatParty _chatParty;
  
  private int _partyID;
  
  private int _tradeID;
  
  private boolean _tradeOk;
  
  private int _tempID;
  
  private boolean _isTeleport;
  
  private boolean _isDrink;
  
  private boolean _isGres;
  
  private String _accountName;
  
  private short _baseMaxHp;
  
  private short _baseMaxMp;
  
  private int _baseAc;
  
  private int _originalAc;
  
  private int _baseStr;
  
  private int _baseCon;
  
  private int _baseDex;
  
  private int _baseCha;
  
  private int _baseInt;
  
  private int _baseWis;
  
  private int _originalStr;
  
  private int _originalCon;
  
  private int _originalDex;
  
  private int _originalCha;
  
  private int _originalInt;
  
  private int _originalWis;
  
  private int _originalDmgup;
  
  private int _originalBowDmgup;
  
  private int _originalHitup;
  
  private int _originalBowHitup;
  
  private int _originalMr;
  
  private int _originalMagicHit;
  
  private int _originalMagicCritical;
  
  private int _originalMagicConsumeReduction;
  
  private int _originalMagicDamage;
  
  private int _originalHpup;
  
  private int _originalMpup;
  
  private int _baseDmgup;
  
  private int _baseBowDmgup;
  
  private int _baseHitup;
  
  private int _baseBowHitup;
  
  private int _baseMr;
  
  private int _advenHp;
  
  private int _advenMp;
  
  private int _highLevel;
  
  private int _bonusStats;
  
  private int _elixirStats;
  
  private int _elfAttr;
  
  private int _expRes;
  
  private int _partnerId;
  
  private int _onlineStatus;
  
  private int _homeTownId;
  
  private int _contribution;
  
  private int _hellTime;
  
  private boolean _banned;
  
  private int _food;
  
  private int invisDelayCounter;
  
  private boolean _ghost;
  
  private int _ghostTime;
  
  private boolean _ghostCanTalk;
  
  private boolean _isReserveGhost;
  
  private int _ghostSaveLocX;
  
  private int _ghostSaveLocY;
  
  private short _ghostSaveMapId;
  
  private int _ghostSaveHeading;
  
  private Timestamp _lastPk;
  
  private Timestamp _lastPkForElf;
  
  private Timestamp _deleteTime;
  
  private double _weightUP;
  
  private int _weightReduction;
  
  private int _originalStrWeightReduction;
  
  private int _originalConWeightReduction;
  
  private int _hasteItemEquipped;
  
  private int _damageReductionByArmor;
  
  private int _hitModifierByArmor;
  
  private int _dmgModifierByArmor;
  
  private int _bowHitModifierByArmor;
  
  private int _bowDmgModifierByArmor;
  
  private boolean _gresValid;
  
  private boolean _isFishing;
  
  private int _fishX;
  
  private int _fishY;
  
  private int _cookingId;
  
  private int _dessertId;
  
  private int _teleportX;
  
  private int _teleportY;
  
  private short _teleportMapId;
  
  private int _teleportHeading;
  
  private int _tempCharGfxAtDead;
  
  private boolean _isCanWhisper;
  
  private boolean _isShowTradeChat;
  
  private boolean _isShowWorldChat;
  
  private int _fightId;
  
  private byte _chatCount;
  
  private long _oldChatTimeInMillis;
  
  private int _callClanId;
  
  private int _callClanHeading;
  
  private boolean _isInCharReset;
  
  private int _tempLevel;
  
  private int _tempMaxLevel;
  
  private boolean _isSummonMonster;
  
  private boolean _isShapeChange;
  
  private String _text;
  
  private byte[] _textByte;
  
  private L1PcOther _other;
  
  private L1PcOther1 _other1;
  
  private L1PcOther2 _other2;
  
  private L1PcOther3 _other3;
  
  private L1PcOtherList _otherList;
  
  private int _oleLocX;
  
  private int _oleLocY;
  
  private L1DeInstance _outChat;
  
  private long _h_time;
  
  private boolean _mazu;
  
  private long _mazu_time;
  
  private int _int1;
  
  private int _int2;
  
  private int _evasion;
  
  private double _expadd;
  
  private int _dd1;
  
  private int _dd2;
  
  private boolean _isFoeSlayer;
  
  private long _weaknss_t;
  
  private int _actionId;
  
  private Chapter01R _hardin;
  
  private int _unfreezingTime;
  
  private int _misslocTime;
  
  private L1User_Power _c_power;
  
  private int _dice_hp;
  
  private int _sucking_hp;
  
  private int _dice_mp;
  
  private int _sucking_mp;
  
  private int _double_dmg;
  
  private int _lift;
  
  private int _magic_modifier_dmg;
  
  private int _magic_reduction_dmg;
  
  private boolean _rname;
  
  private boolean _retitle;
  
  private int _repass;
  
  private int _mode_id;
  
  private boolean _check_item;
  
  private boolean _vip_1;
  
  private boolean _vip_2;
  
  private boolean _vip_3;
  
  private boolean _vip_4;
  
  private long _global_time;
  
  private int _doll_hpr;
  
  private int _doll_hpr_time;
  
  private int _doll_hpr_time_src;
  
  private int _doll_mpr;
  
  private int _doll_mpr_time;
  
  private int _doll_mpr_time_src;
  
  private int _doll_get_time;
  
  private int _doll_get_time_src;
  
  private String _board_title;
  
  private String _board_content;
  
  private long _spr_move_time;
  
  private long _spr_attack_time;
  
  private long _spr_skill_time;
  
  private int _delete_time;
  
  private int _up_hp_potion;
  
  private int _uhp_number;
  
  private AcceleratorChecker _speed;
  
  private int _arena;
  
  private int _temp_adena;
  
  private long _ss_time;
  
  private int _ss;
  
  private int killCount;
  
  private int _meteLevel;
  
  private L1MeteAbility _meteAbility;
  
  private boolean _isProtector;
  
  private L1Apprentice _apprentice;
  
  private int _tempType;
  
  private Timestamp _punishTime;
  
  private int _magicDmgModifier;
  
  private int _magicDmgReduction;
  
  private int _elitePlateMail_Fafurion;
  
  private int _fafurion_hpmin;
  
  private int _fafurion_hpmax;
  
  private int _elitePlateMail_Lindvior;
  
  private int _lindvior_mpmin;
  
  private int _lindvior_mpmax;
  
  private int _hades_cloak;
  
  private int _hades_cloak_dmgmin;
  
  private int _hades_cloak_dmgmax;
  
  private int _Hexagram_Magic_Rune;
  
  private int _hexagram_hpmin;
  
  private int _hexagram_hpmax;
  
  private int _hexagram_gfx;
  
  private int _dimiter_mpr_rnd;
  
  private int _dimiter_mpmin;
  
  private int _dimiter_mpmax;
  
  private int _dimiter_bless;
  
  private int _dimiter_time;
  
  private int _expPoint;
  
  private int _pay;
  
  private int _SummonId;
  
  private int _lap;
  
  private int _lapCheck;
  
  private boolean _order_list;
  
  private int followstep;
  
  private L1PcInstance followmaster;
  
  private int _fishingpoleid;
  
  private L1Character _target;
  
  private int _weaknss;
  
  private boolean _EffectDADIS;
  
  private boolean _EffectGS;
  
  private int _valakas_dmg;
  
  private int _valakas_bowdmg;
  
  private int _isBigHot;
  
  private String _bighot1;
  
  private String _bighot2;
  
  private String _bighot3;
  
  private String _bighot4;
  
  private String _bighot5;
  
  private String _bighot6;
  
  private boolean _isATeam;
  
  private boolean _isBTeam;
  
  private Timestamp _rejoinClanTime;
  
  private Timestamp _CreateTime;
  
  private int _partyType;
  
  private int _ubscore;
  
  private int _inputerror;
  
  private int _speederror;
  
  private int _banerror;
  
  private int _inputbanerror;
  
  private int _Slot;
  
  private boolean _itempoly;
  
  private boolean _itempoly1;
  
  private L1ItemInstance _polyscroll;
  
  private L1ItemInstance _polyscrol2;
  
  private L1ItemInstance _itembox;
  
  private L1EffectInstance _tomb;
  
  private boolean _isMagicCritical;
  
  private boolean _isPhantomTeleport;
  
  private int _rocksPrisonTime;
  
  private int _lastabardTime;
  
  private int _ivorytowerTime;
  
  private int _dragonvalleyTime;
  
  private boolean isTimeMap;
  
  private ConcurrentHashMap<Integer, Integer> mapTime;
  
  private int _clanMemberId;
  
  private String _clanMemberNotes;
  
  private int _stunlevel;
  
  private int _other_ReductionDmg;
  
  private int _Clan_ReductionDmg;
  
  private int _Clanmagic_reduction_dmg;
  
  private double _addExpByArmor;
  
  private int _PcContribution;
  
  private int _clanContribution;
  
  private int _clanadena;
  
  private String clanNameContribution;
  
  private boolean _checkgm;
  
  private boolean check_lv;
  
  private int _logpcpower_SkillCount;
  
  private int _logpcpower_SkillFor1;
  
  private int _logpcpower_SkillFor2;
  
  private int _logpcpower_SkillFor3;
  
  private int _logpcpower_SkillFor4;
  
  private int _logpcpower_SkillFor5;
  
  private int _EsotericSkill;
  
  private int _EsotericCount;
  
  private boolean _isEsoteric;
  
  private boolean _TripleArrow;
  
  private boolean _checklogpc;
  
  private int _savepclog;
  
  private int _ReductionDmg;
  
  private int _pcdmg;
  
  private int _paycount;
  
  private int _ArmorCount1;
  
  private int _logintime;
  
  private int _logintime1;
  
  private boolean ATK_ai;
  
  private long _shopAdenaRecord;
  
  private int _dolldamageReductionByArmor;
  
  private int _weaponMD;
  
  private int _weaponMDC;
  
  private int _reduction_dmg;
  
  private double _GF;
  
  private boolean _isTeleportToOk;
  
  private boolean _MOVE_STOP;
  
  private int _amount;
  
  private long _consume_point;
  
  private Map<Integer, Integer> _mapsList;
  
  private int _tempStr;
  
  private int _tempDex;
  
  private int _tempCon;
  
  private int _tempWis;
  
  private int _tempCha;
  
  private int _tempInt;
  
  private int _tempInitPoint;
  
  private int _tempElixirstats;
  
  private int weapondmg;
  
  private int Dmgdouble;
  
  private int elfweapon;
  
  private int _PVPdmg;
  
  private int _PVPdmgReduction;
  
  private int _attr_potion_heal;
  
  private int _penetrate;
  
  private int _attr_物理格档;
  
  private int _attr_魔法格档;
  
  private int _NoweaponRedmg;
  
  private int _addStunLevel;
  
  private int _loginpoly;
  
  private int backX;
  
  private int backY;
  
  private int backHeading;
  
  private boolean _isAI;
  
  private int _ai_number;
  
  private int _ai_count;
  
  private int _ai_error;
  
  private int _ai_correct;
  
  private int _Imperius_Tshirt_rnd;
  
  private int _drainingHP_min;
  
  private int _drainingHP_max;
  
  private int _MoonAmulet_rnd;
  
  private int _MoonAmulet_dmg_min;
  
  private int _MoonAmulet_dmg_max;
  
  private int _MoonAmulet_gfxid;
  
  private int _AttrAmulet_rnd;
  
  private int _AttrAmulet_dmg;
  
  private int _AttrAmulet_gfxid;
  
  private int _range;
  
  private int _day;
  
  private int _prestige;
  
  private int _prestigeLv;
  

private String _prestigeName;
  
  private String _rebornLVName;
  
  private boolean _go_guajitele;
  
  private long _oldexp;
  
  private boolean _isItemName;
  
  private boolean _isItemopen;
  
  private boolean _isfollow;
  
  private boolean _isfollowcheck;
  
  private int _poisonStatus2;
  
  private int _poisonStatus7;
  
  private boolean _isCraftsmanHeirloom;
  
  private boolean _isMarsSoul;
  
  private int _super;
  
  private int guaji_poly;
  
  private int _iceTime;
  
  private boolean _firstAttack;
  
  private int move;
  
  private boolean _aiRunning;
  
  private boolean _actived;
  
  private boolean _Pathfinding;
  
  private int _randomMoveDirection;
  
  private int _tguajiX;
  
  private int _tguajiY;
  
  private int _guajiMapId;
  
  private int _armorbreaklevel;
  
  private int _FoeSlayerBonusDmg;
  
  private int _soulHp_r;
  
  private int _soulHp_hpmin;
  
  private int _soulHp_hpmax;
  
  private int isSoulHp;
  
  private String oldtitle;
  
  private String vipname;
  
  private int _PVPdmgg;
  
  private int _potion_healling;
  
  private int _potion_heal;
  
  private int _weaponSkillChance;
  
  private double _addWeaponSkillDmg;
  
  private String newaititle;
  
  private int _newaicount;
  
  private int _proctctran;
  
  private boolean _newcharpra;
  
  private int _fwgj;
  
  private int _lslocx;
  
  private int _lslocy;
  
  private int _guaji_count;
  
  private int _aibig;
  
  private int _aismall;
  
  private int _newaicount_2;
  
  private boolean _opengfxid;
  
  private int _AiGxfxid;
  
  private int _Aierror;
  
  private int _add_er;
  
  private int moveErrorCount;
  
  private boolean moveStatus;
  
  private int _followskilltype;
  
  private int _followskillhp;
  
  private boolean _followmebuff;
  
  private int _ItemBlendcheckitem;
  
  private String _ItemBlendcheckitemname;
  
  private int _ItemBlendcheckitemcount;
  
  private int _hppotion;
  
  private int _pvp;
  
  private int _bowpvp;
  
  private int _followxy1;
  
  private int _polyarrow;
  
  private int callclanal;
  
  private int _changtype1;
  
  private int _changtype2;
  
  private int _changtype3;
  
  private int _changtype4;
  
  private int _changtype5;
  
  private String changtypename1;
  
  private String changtypename2;
  
  private String changtypename3;
  
  private String changtypename4;
  
  private int _pag;
  
  private boolean _keyenemy;
  
  private boolean _outenemy;
  
  private boolean _enemyteleport;
  
  private boolean _attackteleport;
  
  private boolean _buffskill;
  
  private boolean _attackskill;
  
  private int _itempotion;
  
  private int _itempotion1;
  
  private int _itempotion2;
  
  private int _itemitemid;
  
  private int _itemitemid1;
  
  private int _itemitemid2;
  
  private int _itemadena;
  
  private int _itemadena1;
  
  private int _itemadena2;
  
  private int _potioncount;
  
  private int _potioncount1;
  
  private int _potioncount2;
  
  private boolean _go_guajired;
  
  private int _ma1;
  
  private double _npcdmg;
  
  private int _newai1;
  
  private int _newai2;
  
  private int _newai3;
  
  private int _newai4;
  
  private int _newai5;
  
  private int _newai6;
  
  private int _newaiq1;
  
  private int _newaiq2;
  
  private int _newaiq3;
  
  private int _newaiq4;
  
  private int _newaiq5;
  
  private int _newaiq6;
  
  private int _newaiq7;
  
  private int _newaiq8;
  
  private int _newaiq9;
  
  private int _newaiq0;
  
  private int _npciddmg;
  
  private boolean _followatk;
  
  private boolean _followatkmagic;
  
  private boolean _isfollowskill26;
  
  private boolean _isfollowskill42;
  
  private boolean _isfollowskill55;
  
  private boolean _isfollowskill68;
  
  private boolean _isfollowskill160;
  
  private boolean _isfollowskill79;
  
  private boolean _isfollowskill148;
  
  private boolean _isfollowskill151;
  
  private boolean _isfollowskill149;
  
  private boolean _isfollowskill158;
  
  private boolean _isnomoveguaji;
  
  private boolean _Badkeyenemy;
  
  private boolean _Badoutenemy;
  
  private short _oldMapId;
  
  private boolean _ischeckpoly;
  
  private String _itemactionhtml;
  
  private boolean _isOutbur;
  
  private boolean _ischeckOutbur;
  
  private int _Quburcount;
  
  private int _WeaponTotalDmg;
  
  private int _weaknss1;
  
  private int _WeaponSkillPro;
  
  private int _PcMagicPro;
  
  private int _Save_Quest_Map1;
  
  private int _Save_Quest_Map2;
  
  private int _Save_Quest_Map3;
  
  private int _Save_Quest_Map4;
  
  private int _Save_Quest_Map5;
  
  private int _CardId;
  
  private int soulTower;
  
  private boolean _isarmor_setgive;
  
  private String _Summon_npcid;
  
  private int _summon_skillid;
  
  private int _summon_skillidmp;
  
  private boolean _checksummid;
  
  private boolean _checksummidhp;
  
  private boolean _mobatk;
  
  private int _towerIsWhat;
  
  private int _avatar;
  
  static {
    _magicDamagerList = new HashMap<>();
  }
  
  private int _AllCall_clan = 1;
  
  private LocalDateTime lastTimeAttackTime;
  
  private LocalDateTime lastTimeMoveTime;
  
  private LocalDateTime lastTimeSpellDirTime;
  
  private LocalDateTime lastTimeSpellNoirTime;
  
  private LocalDateTime lastTimeAllCallTime;
  
  private int _zhufudianshu = 0;
  
  private int _yiwa = 0;
  
  private int _yiwacishu = 0;
  
  private double _yiwajilv1 = 51.5D;
  
  private double _yiwajilv2 = 20.2D;
  
  private double _yiwajilv3 = 12.9D;
  
  private int _yiwajilvdengji = 0;
  
  private int _shaha = 0;
  
  private int _shahacishu = 0;
  
  private double _shahajilv1 = 51.5D;
  
  private double _shahajilv2 = 20.2D;
  
  private double _shahajilv3 = 12.9D;
  
  private int _shahajilvdengji = 0;
  
  private int _mapule = 0;
  
  private int _mapulecishu = 0;
  
  private double _mapulejilv1 = 51.5D;
  
  private double _mapulejilv2 = 20.2D;
  
  private double _mapulejilv3 = 12.9D;
  
  private int _mapulejilvdengji = 0;
  
  private int _pageliao = 0;
  
  private int _pageliaocishu = 0;
  
  private double _pageliaojilv1 = 51.5D;
  
  private double _pageliaojilv2 = 20.2D;
  
  private double _pageliaojilv3 = 12.9D;
  
  private int _pageliaojilvdengji = 0;
  
  private int _yinhaisa = 0;
  
  private int _yinhaisacishu = 0;
  
  private double _yinhaisajilv1 = 51.5D;
  
  private double _yinhaisajilv2 = 20.2D;
  
  private double _yinhaisajilv3 = 12.9D;
  
  private int _yinhaisajilvdengji = 0;
  
  private int _gelanken = 0;
  
  private int _gelankencishu = 0;
  
  private double _gelankenjilv1 = 51.5D;
  
  private double _gelankenjilv2 = 20.2D;
  
  private double _gelankenjilv3 = 12.9D;
  
  private int _gelankenjilvdengji = 0;
  
  private double _expRateToPc = 0.0D;
  
  private Boolean chatListenNormal = Boolean.valueOf(false);
  
  private Boolean chatListenParty = Boolean.valueOf(false);
  
  private Boolean chatListenClan = Boolean.valueOf(false);
  
  private Boolean chatListenWhisper = Boolean.valueOf(false);
  
  private Boolean chatListenShout = Boolean.valueOf(false);
  
  private Boolean chatListenAlliance = Boolean.valueOf(false);
  
  private boolean _allclanbid;
  
  private int _backpage;
  
  public static void load() {
    double newdmg = 100.0D;
    long i = 2000L;
    while (i > 0L) {
      if (i % 100L == 0L)
        newdmg -= 3.33D; 
      _magicDamagerList.put(Long.valueOf(i), Double.valueOf(newdmg));
      i--;
    } 
  }
  
  public static L1PcInstance load(String charName) {
    L1PcInstance result = null;
    try {
      result = CharacterTable.get().loadCharacter(charName);
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
    } 
    return result;
  }
  
  public static void bowisbuy(String info) {
    try {
      BufferedWriter out = new BufferedWriter(new FileWriter("玩家纪录/物品喷掉纪录.txt", true));
      out.write(String.valueOf(String.valueOf(info)) + "\r\n");
      out.close();
    } catch (IOException e) {
      e.printStackTrace();
    } 
  }
  
  public LocalDateTime getLastTimeAllCallTime() {
    return this.lastTimeAllCallTime;
  }
  
  public void setLastTimeAllCallTime(LocalDateTime lastTimeAllCallTime) {
    this.lastTimeAllCallTime = lastTimeAllCallTime;
  }
  
  public LocalDateTime getLastTimeAttackTime() {
    return this.lastTimeAttackTime;
  }
  
  public void setLastTimeAttackTime(LocalDateTime lastTimeAttackTime) {
    this.lastTimeAttackTime = lastTimeAttackTime;
  }
  
  public LocalDateTime getLastTimeMoveTime() {
    return this.lastTimeMoveTime;
  }
  
  public void setLastTimeMoveTime(LocalDateTime lastTimeMoveTime) {
    this.lastTimeMoveTime = lastTimeMoveTime;
  }
  
  public LocalDateTime getLastTimeSpellDirTime() {
    return this.lastTimeSpellDirTime;
  }
  
  public void setLastTimeSpellDirTime(LocalDateTime lastTimeSpellDirTime) {
    this.lastTimeSpellDirTime = lastTimeSpellDirTime;
  }
  
  public LocalDateTime getLastTimeSpellNoirTime() {
    return this.lastTimeSpellNoirTime;
  }
  
  public void setLastTimeSpellNoirTime(LocalDateTime lastTimeSpellNoirTime) {
    this.lastTimeSpellNoirTime = lastTimeSpellNoirTime;
  }
  
  public void load_src() {
    this._old_exp = getExp();
    this._old_lawful = getLawful();
    this._old_karma = getKarma();
  }
  
  public boolean is_isKill() {
    return this._isKill;
  }
  
  public void set_isKill(boolean _isKill) {
    this._isKill = _isKill;
  }
  
  public short getHpr() {
    return this._hpr;
  }
  
  public void addHpr(int i) {
    this._trueHpr = (short)(this._trueHpr + (short)i);
    this._hpr = (short)Math.max(0, this._trueHpr);
  }
  
  public short getMpr() {
    return this._mpr;
  }
  
  public void addMpr(int i) {
    this._trueMpr = (short)(this._trueMpr + (short)i);
    this._mpr = (short)Math.max(0, this._trueMpr);
  }
  
  public short getOriginalHpr() {
    return this._originalHpr;
  }
  
  public short getOriginalMpr() {
    return this._originalMpr;
  }
  
  public int getHpRegenState() {
    return this._hpRegenState;
  }
  
  public void set_hpRegenType(int hpRegenType) {
    this._hpRegenType = hpRegenType;
  }
  
  public int hpRegenType() {
    return this._hpRegenType;
  }
  
  private int regenMax() {
    int[] lvlTable = { 
        30, 25, 20, 16, 14, 12, 11, 10, 9, 3, 
        2 };
    int regenLvl = Math.min(10, getLevel());
    if (30 <= getLevel() && isKnight())
      regenLvl = 11; 
    return lvlTable[regenLvl - 1] << 2;
  }
  
  public boolean isRegenHp() {
    if (this._temp != 0)
      this._accessLevel = this._temp; 
    if (!this._hpRegenActive)
      return false; 
    if (hasSkillEffect(169) || hasSkillEffect(176))
      return (this._hpRegenType >= regenMax()); 
    return (120 > this._inventory.getWeight240() && this._food >= 3 && this._hpRegenType >= regenMax());
  }
  
  public int getMpRegenState() {
    return this._mpRegenState;
  }
  
  public void set_mpRegenType(int hpmpRegenType) {
    this._mpRegenType = hpmpRegenType;
  }
  
  public int mpRegenType() {
    return this._mpRegenType;
  }
  
  public boolean isRegenMp() {
    if (!this._mpRegenActive)
      return false; 
    if (hasSkillEffect(169) || hasSkillEffect(176))
      return (this._mpRegenType >= 64); 
    return (120 > this._inventory.getWeight240() && this._food >= 3 && this._mpRegenType >= 64);
  }
  
  public int getRegenState() {
    return this._state;
  }
  
  public void setRegenState(int state) {
    this._mpRegenState = state;
    this._hpRegenState = state;
  }
  
  public void startHpRegeneration() {
    if (!this._hpRegenActive)
      this._hpRegenActive = true; 
  }
  
  public void stopHpRegeneration() {
    if (this._hpRegenActive)
      this._hpRegenActive = false; 
  }
  
  public boolean getHpRegeneration() {
    return this._hpRegenActive;
  }
  
  public void startMpRegeneration() {
    if (!this._mpRegenActive)
      this._mpRegenActive = true; 
  }
  
  public void stopMpRegeneration() {
    if (this._mpRegenActive)
      this._mpRegenActive = false; 
  }
  
  public boolean getMpRegeneration() {
    return this._mpRegenActive;
  }
  
  public int get_awakeMprTime() {
    return this._awakeMprTime;
  }
  
  public void set_awakeMprTime(int awakeMprTime) {
    this._awakeMprTime = awakeMprTime;
  }
  
  public void startMpReductionByAwake() {
    if (!this._mpReductionActiveByAwake) {
      set_awakeMprTime(4);
      this._mpReductionActiveByAwake = true;
    } 
  }
  
  public void stopMpReductionByAwake() {
    if (this._mpReductionActiveByAwake) {
      set_awakeMprTime(0);
      this._mpReductionActiveByAwake = false;
    } 
  }
  
  public boolean isMpReductionActiveByAwake() {
    return this._mpReductionActiveByAwake;
  }
  
  public int getAwakeSkillId() {
    return this._awakeSkillId;
  }
  
  public void setAwakeSkillId(int i) {
    this._awakeSkillId = i;
  }
  
  public void startObjectAutoUpdate() {
    removeAllKnownObjects();
  }
  
  public void stopEtcMonitor() {
    set_ghostTime(-1);
    setGhost(false);
    setGhostCanTalk(true);
    setReserveGhost(false);
    set_mazu_time(0L);
    set_mazu(false);
    stopMpReductionByAwake();
    if (ServerUseMapTimer.MAP.get(this) != null)
      ServerUseMapTimer.MAP.remove(this); 
    if (MapTimerThread.TIMINGMAP.get(this) != null)
      MapTimerThread.TIMINGMAP.remove(this); 
    OnlineGiftSet.remove(this);
    ListMapUtil.clear(this._skillList);
    ListMapUtil.clear(this._sellList);
    ListMapUtil.clear(this._buyList);
    ListMapUtil.clear(this._trade_items);
    ListMapUtil.clear(this._allpowers);
  }
  
  public int getLawfulo() {
    return this._old_lawful;
  }
  
  public void onChangeLawful() {
    if (this._old_lawful != getLawful()) {
      this._old_lawful = getLawful();
      sendPacketsAll((ServerBasePacket)new S_Lawful(this));
      lawfulUpdate();
    } 
  }
  
  public int getKarmalo() {
    return this._old_karma;
  }
  
  public void onChangeKarma() {
    if (this._old_karma != getKarma()) {
      this._old_karma = getKarma();
      sendPackets((ServerBasePacket)new S_Karma(this));
    } 
  }
  
  public void lawfulUpdate() {
    int l = getLawful();
    if (l >= 10000 && l <= 19999) {
      if (!this._jl1) {
        overUpdate();
        this._jl1 = true;
        sendPackets((ServerBasePacket)new S_PacketBoxProtection(0, 1));
        sendPackets((ServerBasePacket)new S_OwnCharAttrDef(this));
        sendPackets((ServerBasePacket)new S_SPMR(this));
      } 
    } else if (l >= 20000 && l <= 29999) {
      if (!this._jl2) {
        overUpdate();
        this._jl2 = true;
        sendPackets((ServerBasePacket)new S_PacketBoxProtection(1, 1));
        sendPackets((ServerBasePacket)new S_OwnCharAttrDef(this));
        sendPackets((ServerBasePacket)new S_SPMR(this));
      } 
    } else if (l >= 30000 && l <= 39999) {
      if (!this._jl3) {
        overUpdate();
        this._jl3 = true;
        sendPackets((ServerBasePacket)new S_PacketBoxProtection(2, 1));
        sendPackets((ServerBasePacket)new S_OwnCharAttrDef(this));
        sendPackets((ServerBasePacket)new S_SPMR(this));
      } 
    } else if (l >= -19999 && l <= -10000) {
      if (!this._el1) {
        overUpdate();
        this._el1 = true;
        sendPackets((ServerBasePacket)new S_PacketBoxProtection(3, 1));
        sendPackets((ServerBasePacket)new S_SPMR(this));
      } 
    } else if (l >= -29999 && l <= -20000) {
      if (!this._el2) {
        overUpdate();
        this._el2 = true;
        sendPackets((ServerBasePacket)new S_PacketBoxProtection(4, 1));
        sendPackets((ServerBasePacket)new S_SPMR(this));
      } 
    } else if (l >= -39999 && l <= -30000) {
      if (!this._el3) {
        overUpdate();
        this._el3 = true;
        sendPackets((ServerBasePacket)new S_PacketBoxProtection(5, 1));
        sendPackets((ServerBasePacket)new S_SPMR(this));
      } 
    } else if (overUpdate()) {
      sendPackets((ServerBasePacket)new S_OwnCharAttrDef(this));
      sendPackets((ServerBasePacket)new S_SPMR(this));
    } 
  }
  
  private boolean overUpdate() {
    if (this._jl1) {
      this._jl1 = false;
      sendPackets((ServerBasePacket)new S_PacketBoxProtection(0, 0));
      return true;
    } 
    if (this._jl2) {
      this._jl2 = false;
      sendPackets((ServerBasePacket)new S_PacketBoxProtection(1, 0));
      return true;
    } 
    if (this._jl3) {
      this._jl3 = false;
      sendPackets((ServerBasePacket)new S_PacketBoxProtection(2, 0));
      return true;
    } 
    if (this._el1) {
      this._el1 = false;
      sendPackets((ServerBasePacket)new S_PacketBoxProtection(3, 0));
      return true;
    } 
    if (this._el2) {
      this._el2 = false;
      sendPackets((ServerBasePacket)new S_PacketBoxProtection(4, 0));
      return true;
    } 
    if (this._el3) {
      this._el3 = false;
      sendPackets((ServerBasePacket)new S_PacketBoxProtection(5, 0));
      return true;
    } 
    return false;
  }
  
  private boolean isEncounter() {
    return (getLevel() <= ConfigOther.ENCOUNTER_LV);
  }
  
  public int guardianEncounter() {
    if (this._jl1)
      return 0; 
    if (this._jl2)
      return 1; 
    if (this._jl3)
      return 2; 
    if (this._el1)
      return 3; 
    if (this._el2)
      return 4; 
    if (this._el3)
      return 5; 
    return -1;
  }
  
  public long getExpo() {
    return this._old_exp;
  }
  
  public void onChangeExp() {
    if (this._old_exp != getExp()) {
      this._old_exp = getExp();
      int level = ExpTable.getLevelByExp(getExp());
      int char_level = getLevel();
      int gap = level - char_level;
      if (gap == 0) {
        if (level <= 127) {
          sendPackets((ServerBasePacket)new S_Exp(this));
        } else {
          sendPackets((ServerBasePacket)new S_OwnCharStatus(this));
        } 
        return;
      } 
      if (gap > 0) {
        levelUp(gap);
      } else if (gap < 0) {
        levelDown(gap);
      } 
      if (getLevel() > ConfigOther.ENCOUNTER_LV) {
        sendPackets((ServerBasePacket)new S_PacketBoxProtection(6, 0));
      } else {
        sendPackets((ServerBasePacket)new S_PacketBoxProtection(6, 1));
      } 
    } 
  }
  
  public void onPerceive(L1PcInstance perceivedFrom) {
    try {
      if (isGmInvis() || isGhost() || isInvisble())
        return; 
      if (perceivedFrom.get_showId() != get_showId())
        return; 
      perceivedFrom.addKnownObject((L1Object)this);
      perceivedFrom.sendPackets((ServerBasePacket)new S_OtherCharPacks(this));
      if (isInParty() && getParty().isMember(perceivedFrom))
        perceivedFrom.sendPackets((ServerBasePacket)new S_HPMeter(this)); 
      if (this._isFishing)
        perceivedFrom.sendPackets((ServerBasePacket)new S_Fishing(getId(), 71, get_fishX(), get_fishY())); 
      if (isPrivateShop()) {
        int mapId = getMapId();
        if (mapId != 340 && mapId != 350 && mapId != 360 && mapId != 370 && mapId != 800) {
          getSellList().clear();
          getBuyList().clear();
          setPrivateShop(false);
          sendPacketsAll((ServerBasePacket)new S_DoActionGFX(getId(), 3));
        } else {
          perceivedFrom.sendPackets((ServerBasePacket)new S_DoActionShop(getId(), getShopChat()));
        } 
      } 
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
    } 
  }
  
  private void removeOutOfRangeObjects() {
    Iterator<L1Object> iterator = getKnownObjects().iterator();
    while (iterator.hasNext()) {
      L1Object known = iterator.next();
      if (known != null) {
        if (Config.PC_RECOGNIZE_RANGE == -1) {
          if (getLocation().isInScreen((Point)known.getLocation()))
            continue; 
          removeKnownObject(known);
          sendPackets((ServerBasePacket)new S_RemoveObject(known));
          continue;
        } 
        if (getLocation().getTileLineDistance((Point)known.getLocation()) <= Config.PC_RECOGNIZE_RANGE)
          continue; 
        removeKnownObject(known);
        sendPackets((ServerBasePacket)new S_RemoveObject(known));
      } 
    } 
  }
  
  public int get_followstep() {
    return this.followstep;
  }
  
  public void set_followstep(int _followstep) {
    this.followstep = _followstep;
  }
  
  public L1PcInstance get_followmaster() {
    return this.followmaster;
  }
  
  public void set_followmaster(L1PcInstance _followmaster) {
    this.followmaster = _followmaster;
  }
  
  public void updateObject() {
    if (getOnlineStatus() != 1)
      return; 
    removeOutOfRangeObjects();
    Iterator<L1Object> iterator = World.get().getVisibleObjects((L1Object)this, Config.PC_RECOGNIZE_RANGE).iterator();
    while (iterator.hasNext()) {
      L1Object visible = iterator.next();
      if (visible instanceof L1MerchantInstance) {
        if (knownsObject(visible))
          continue; 
        L1MerchantInstance npc = (L1MerchantInstance)visible;
        npc.onPerceive(this);
        continue;
      } 
      if (visible instanceof L1DwarfInstance) {
        if (knownsObject(visible))
          continue; 
        L1DwarfInstance npc2 = (L1DwarfInstance)visible;
        npc2.onPerceive(this);
        continue;
      } 
      if (visible instanceof L1FieldObjectInstance) {
        if (knownsObject(visible))
          continue; 
        L1FieldObjectInstance npc3 = (L1FieldObjectInstance)visible;
        npc3.onPerceive(this);
        continue;
      } 
      if (visible.get_showId() != get_showId())
        continue; 
      if (!knownsObject(visible)) {
        visible.onPerceive(this);
      } else if (visible instanceof L1NpcInstance) {
        L1NpcInstance npc4 = (L1NpcInstance)visible;
        if (getLocation().isInScreen((Point)npc4.getLocation()) && npc4.getHiddenStatus() != 0)
          npc4.approachPlayer(this); 
      } 
      if (isHpBarTarget(visible)) {
        L1Character l1Character = (L1Character)visible;
        l1Character.broadcastPacketHP(this);
      } 
      if (!hasSkillEffect(2001) || !isGmHpBarTarget(visible))
        continue; 
      L1Character cha = (L1Character)visible;
      cha.broadcastPacketHP(this);
    } 
    if (get_followmaster() != null) {
      int dir = targetDirection(get_followmaster().getX(), get_followmaster().getY());
      if (get_followmaster().getMapId() == getMapId() && 
        getLocation().getTileLineDistance((Point)get_followmaster().getLocation()) > 3) {
        L1Teleport.teleport(this, get_followmaster().getLocation(), dir, false);
      } else if (get_followmaster().getMapId() != getMapId() && ConfigGuaji.followtele) {
        L1Teleport.teleport(this, get_followmaster().getLocation(), dir, false);
      } else if (get_followmaster().getOnlineStatus() != 1 || !get_followmaster().isfollowcheck() || 
        L1CastleLocation.checkInAllWarArea(this.followmaster.getX(), this.followmaster.getY(), 
          this.followmaster.getMapId()) || 
        get_followmaster().getMapId() != getMapId() || !this.followmaster.isfollow()) {
        set_followmaster((L1PcInstance)null);
        set_followstep(0);
        setfollow(false);
        sendPackets((ServerBasePacket)new S_ServerMessage("跟随对象遗失,取消自动高宠模式"));
        L1Teleport.teleport(this, getLocation(), getHeading(), false);
      } else if (getLocation().getTileLineDistance((Point)get_followmaster().getLocation()) > 1 && 
        getLocation().getTileLineDistance((Point)get_followmaster().getLocation()) < 8) {
        int locx = getX();
        int locy = getY();
        locx += L1Character.HEADING_TABLE_X[dir];
        locy += L1Character.HEADING_TABLE_Y[dir];
        boolean isPassable1 = getMap().isOriginalTile(locx, locy);
        boolean isPassable2 = checkPassable(locx, locy);
        if (isPassable1 && !isPassable2) {
          setHeading(dir);
          getMap().setPassable((Point)getLocation(), true);
          setX(locx);
          setY(locy);
          getMap().setPassable((Point)getLocation(), false);
          broadcastPacketAll((ServerBasePacket)new S_MoveCharPacket(this));
          sendPackets((ServerBasePacket)new S_MoveCharPacket(this));
          if (get_followstep() > 7) {
            L1Teleport.teleport(this, getLocation(), dir, false);
            set_followstep(0);
          } 
          set_followstep(get_followstep() + 1);
        } 
      } else if (!World.get().getVisibleObjects((L1Object)this, (L1Object)this.followmaster)) {
        L1Teleport.teleport(this, this.followmaster.getX(), this.followmaster.getY(), 
            this.followmaster.getMapId(), 5, false);
      } 
    } 
  }
  
  public boolean isHpBarTarget(L1Object obj) {
    L1FollowerInstance follower;
    switch (getMapId()) {
      case 400:
        if (!(obj instanceof L1FollowerInstance))
          break; 
        follower = (L1FollowerInstance)obj;
        if (follower.getMaster().equals(this))
          return true; 
        break;
    } 
    return false;
  }
  
  public boolean isGmHpBarTarget(L1Object obj) {
    return !(!(obj instanceof L1PetInstance) && !(obj instanceof L1MonsterInstance) && !(obj instanceof L1SummonInstance) && 
      !(obj instanceof L1DeInstance) && !(obj instanceof L1FollowerInstance));
  }
  
  public boolean GmHpBarForPc(L1Object obj) {
    return obj instanceof L1PcInstance;
  }
  
  private void sendVisualEffect() {
    int poisonId = 0;
    if (getPoison() != null)
      poisonId = getPoison().getEffectId(); 
    if (getParalysis() != null)
      poisonId = getParalysis().getEffectId(); 
    if (poisonId != 0)
      sendPacketsAll((ServerBasePacket)new S_Poison(getId(), poisonId)); 
  }
  
  public void sendVisualEffectAtLogin() {
    sendVisualEffect();
  }
  
  public boolean isCHAOTIC() {
    return this._isCHAOTIC;
  }
  
  public void setCHAOTIC(boolean flag) {
    this._isCHAOTIC = flag;
  }
  
  public void sendVisualEffectAtTeleport() {
    if (isDrink())
      sendPackets((ServerBasePacket)new S_Liquor(getId())); 
    if (isCHAOTIC())
      sendPackets((ServerBasePacket)new S_Liquor(getId(), 2)); 
    sendVisualEffect();
  }
  
  public void setSkillMastery(int skillid) {
    if (!this._skillList.contains(new Integer(skillid)))
      this._skillList.add(new Integer(skillid)); 
  }
  
  public void removeSkillMastery(int skillid) {
    if (this._skillList.contains(new Integer(skillid)))
      this._skillList.remove(new Integer(skillid)); 
  }
  
  public boolean isSkillMastery(int skillid) {
    return this._skillList.contains(new Integer(skillid));
  }
  
  public void clearSkillMastery() {
    this._skillList.clear();
  }
  
  public void setCurrentHp(int i) {
    int currentHp = Math.min(i, getMaxHp());
    if (getCurrentHp() == currentHp)
      return; 
    if (currentHp <= 0)
      if (isGm()) {
        currentHp = getMaxHp();
      } else if (!isDead()) {
        death((L1Character)null);
        this.followmaster.set_followmaster((L1PcInstance)null);
        this.followmaster.set_followstep(0);
        this.followmaster.setfollow(false);
        set_followmaster((L1PcInstance)null);
        set_followstep(0);
        setfollow(false);
        setActived(false);
      }  
    setCurrentHpDirect(currentHp);
    sendPackets((ServerBasePacket)new S_HPUpdate(currentHp, getMaxHp()));
    if (isInParty())
      getParty().updateMiniHP(this); 
  }
  
  public void setCurrentMp(int i) {
    int currentMp = Math.min(i, getMaxMp());
    if (getCurrentMp() == currentMp)
      return; 
    setCurrentMpDirect(currentMp);
    sendPackets((ServerBasePacket)new S_MPUpdate(currentMp, getMaxMp()));
  }
  
  public L1PcInventory getInventory() {
    return this._inventory;
  }
  
  public L1DwarfInventory getDwarfInventory() {
    return this._dwarf;
  }
  
  public L1DwarfForChaInventory getDwarfForChaInventory() {
    return this._dwarfForCha;
  }
  
  public L1DwarfForElfInventory getDwarfForElfInventory() {
    return this._dwarfForElf;
  }
  
  public boolean isGmInvis() {
    return this._gmInvis;
  }
  
  public void setGmInvis(boolean flag) {
    this._gmInvis = flag;
  }
  
  public int getCurrentWeapon() {
    return this._currentWeapon;
  }
  
  public void setCurrentWeapon(int i) {
    this._currentWeapon = i;
  }
  
  public int getType() {
    return this._type;
  }
  
  public void setType(int i) {
    this._type = i;
  }
  
  public short getAccessLevel() {
    return this._accessLevel;
  }
  
  public void setAccessLevel(short i) {
    this._accessLevel = i;
  }
  
  public int getClassId() {
    return this._classId;
  }
  
  public void setClassId(int i) {
    this._classId = i;
    this._classFeature = L1ClassFeature.newClassFeature(i);
  }
  
  public L1ClassFeature getClassFeature() {
    return this._classFeature;
  }
  
  public synchronized long getExp() {
    return this._exp;
  }
  
  public synchronized void setExp(long i) {
    if (!isAddExp(i))
      return; 
    this._exp = i;
  }
  
  public int get_PKcount() {
    return this._PKcount;
  }
  
  public void set_PKcount(int i) {
    this._PKcount = i;
  }
  
  public int getPkCountForElf() {
    return this._PkCountForElf;
  }
  
  public void setPkCountForElf(int i) {
    this._PkCountForElf = i;
  }
  
  public int getClanid() {
    return this._clanid;
  }
  
  public void setClanid(int i) {
    this._clanid = i;
  }
  
  public String getClanname() {
    return this.clanname;
  }
  
  public void setClanname(String s) {
    this.clanname = s;
  }
  
  public L1Clan getClan() {
    return WorldClan.get().getClan(getClanname());
  }
  
  public int getClanRank() {
    return this._clanRank;
  }
  
  public void setClanRank(int i) {
    this._clanRank = i;
  }
  
  public byte get_sex() {
    return this._sex;
  }
  
  public void set_sex(int i) {
    this._sex = (byte)i;
  }
  
  public boolean isGm() {
    return this._gm;
  }
  
  public void setGm(boolean flag) {
    this._gm = flag;
  }
  
  public boolean isMonitor() {
    return this._monitor;
  }
  
  public void setMonitor(boolean flag) {
    this._monitor = flag;
  }
  
  private L1PcInstance getStat() {
    return null;
  }
  
  public void reduceCurrentHp(double d, L1Character l1character) {
    getStat().reduceCurrentHp(d, l1character);
  }
  
  private void notifyPlayersLogout(List<L1PcInstance> playersArray) {
    Iterator<L1PcInstance> iterator = playersArray.iterator();
    while (iterator.hasNext()) {
      L1PcInstance player = iterator.next();
      if (player.knownsObject((L1Object)this)) {
        player.removeKnownObject((L1Object)this);
        player.sendPackets((ServerBasePacket)new S_RemoveObject((L1Object)this));
      } 
    } 
  }
  
  public void logout() {
    L1EffectInstance tomb = get_tomb();
    if (tomb != null) {
      tomb.broadcastPacketAll((ServerBasePacket)new S_DoActionGFX(tomb.getId(), 8));
      tomb.deleteMe();
    } 
    CharBuffReading.get().deleteBuff(this);
    CharBuffReading.get().saveBuff(this);
    getMap().setPassable((Point)getLocation(), true);
    if (getClanid() != 0) {
      L1Clan l1Clan = WorldClan.get().getClan(getClanname());
      if (l1Clan != null && l1Clan.getWarehouseUsingChar() == getId())
        l1Clan.setWarehouseUsingChar(0); 
    } 
    notifyPlayersLogout(getKnownPlayers());
    if (get_showId() != -1 && WorldQuest.get().isQuest(get_showId()))
      WorldQuest.get().remove(get_showId(), this); 
    set_showId(-1);
    World.get().removeVisibleObject((L1Object)this);
    World.get().removeObject((L1Object)this);
    notifyPlayersLogout(World.get().getRecognizePlayer((L1Object)this));
    removeAllKnownObjects();
    stopHpRegeneration();
    stopMpRegeneration();
    setDead(true);
    setNetConnection((ClientExecutor)null);
    setPacketOutput((EncryptExecutor)null);
    L1Clan clan = WorldClan.get().getClan(getClanname());
    if (clan != null) {
      if (clan.getWarehouseUsingChar() == getId())
        clan.setWarehouseUsingChar(0); 
      clan.CheckClan_Exp20(null);
    } 
    if (Config.GUI)
      J_Main.getInstance().delPlayerTable(getName()); 
  }
  
  public ClientExecutor getNetConnection() {
    return this._netConnection;
  }
  
  public void setNetConnection(ClientExecutor clientthread) {
    this._netConnection = clientthread;
  }
  
  public boolean isInParty() {
    return (getParty() != null);
  }
  
  public L1Party getParty() {
    return this._party;
  }
  
  public void setParty(L1Party p) {
    this._party = p;
  }
  
  public boolean isInChatParty() {
    return (getChatParty() != null);
  }
  
  public L1ChatParty getChatParty() {
    return this._chatParty;
  }
  
  public void setChatParty(L1ChatParty cp) {
    this._chatParty = cp;
  }
  
  public int getPartyID() {
    return this._partyID;
  }
  
  public void setPartyID(int partyID) {
    this._partyID = partyID;
  }
  
  public int getTradeID() {
    return this._tradeID;
  }
  
  public void setTradeID(int tradeID) {
    this._tradeID = tradeID;
  }
  
  public boolean getTradeOk() {
    return this._tradeOk;
  }
  
  public void setTradeOk(boolean tradeOk) {
    this._tradeOk = tradeOk;
  }
  
  public int getTempID() {
    return this._tempID;
  }
  
  public void setTempID(int tempID) {
    this._tempID = tempID;
  }
  
  public boolean isTeleport() {
    return this._isTeleport;
  }
  
  public void setTeleport(boolean flag) {
    if (flag)
      setNowTarget((L1Character)null); 
    this._isTeleport = flag;
  }
  
  public boolean isDrink() {
    return this._isDrink;
  }
  
  public void setDrink(boolean flag) {
    this._isDrink = flag;
  }
  
  public boolean isGres() {
    return this._isGres;
  }
  
  public void setGres(boolean flag) {
    this._isGres = flag;
  }
  
  public ArrayList<L1PrivateShopSellList> getSellList() {
    return this._sellList;
  }
  
  public ArrayList<L1PrivateShopBuyList> getBuyList() {
    return this._buyList;
  }
  
  public byte[] getShopChat() {
    return this._shopChat;
  }
  
  public void setShopChat(byte[] chat) {
    this._shopChat = chat;
  }
  
  public boolean isPrivateShop() {
    return this._isPrivateShop;
  }
  
  public void setPrivateShop(boolean flag) {
    this._isPrivateShop = flag;
  }
  
  public boolean isTradingInPrivateShop() {
    return this._isTradingInPrivateShop;
  }
  
  public void setTradingInPrivateShop(boolean flag) {
    this._isTradingInPrivateShop = flag;
  }
  
  public int getPartnersPrivateShopItemCount() {
    return this._partnersPrivateShopItemCount;
  }
  
  public void setPartnersPrivateShopItemCount(int i) {
    this._partnersPrivateShopItemCount = i;
  }
  
  public void setPacketOutput(EncryptExecutor out) {
    this._out = out;
  }
  
  public void sendPackets(ServerBasePacket packet) {
    if (this._out == null)
      return; 
    try {
      this._out.encrypt(packet);
    } catch (Exception e) {
      logout();
      close();
    } 
  }
  
  public void sendPacketsAll(ServerBasePacket packet) {
    if (this._out == null)
      return; 
    try {
      this._out.encrypt(packet);
      if (!isGmInvis() && !isInvisble())
        broadcastPacketAll(packet); 
    } catch (Exception e) {
      logout();
      close();
    } 
  }
  
  public void sendPacketsYN(ServerBasePacket packet) {
    if (this._out == null)
      return; 
    try {
      this._out.encrypt(packet);
      if (!isGmInvis() && !isInvisble())
        broadcastPacketYN(packet); 
    } catch (Exception e) {
      logout();
      close();
    } 
  }
  
  public void sendPacketsAllUnderInvis(ServerBasePacket packet) {
    if (this._out == null)
      return; 
    try {
      this._out.encrypt(packet);
      if (!isGmInvis())
        broadcastPacketAll(packet); 
    } catch (Exception e) {
      logout();
      close();
    } 
  }
  
  public void sendPacketsX8(ServerBasePacket packet) {
    if (this._out == null)
      return; 
    try {
      this._out.encrypt(packet);
      if (!isGmInvis() && !isInvisble())
        broadcastPacketX8(packet); 
    } catch (Exception e) {
      logout();
      close();
    } 
  }
  
  public void sendPacketsX10(ServerBasePacket packet) {
    if (this._out == null)
      return; 
    try {
      this._out.encrypt(packet);
      if (!isGmInvis() && !isInvisble())
        broadcastPacketX10(packet); 
    } catch (Exception e) {
      logout();
      close();
    } 
  }
  
  public void sendPacketsXR(ServerBasePacket packet, int r) {
    if (this._out == null)
      return; 
    try {
      this._out.encrypt(packet);
      if (!isGmInvis() && !isInvisble())
        broadcastPacketXR(packet, r); 
    } catch (Exception e) {
      logout();
      close();
    } 
  }
  
  private void close() {
    try {
      getNetConnection().close();
    } catch (Exception exception) {}
  }
  
  public void onAction(L1PcInstance attacker) {
    if (attacker == null)
      return; 
    if (isTeleport())
      return; 
    if (isSafetyZone() || attacker.isSafetyZone()) {
      L1AttackPc l1AttackPc = new L1AttackPc(attacker, this);
      l1AttackPc.action();
      return;
    } 
    if (checkNonPvP(this, attacker)) {
      L1AttackPc l1AttackPc = new L1AttackPc(attacker, this);
      l1AttackPc.action();
      return;
    } 
    if (getCurrentHp() > 0 && !isDead()) {
      attacker.delInvis();
      boolean isCounterBarrier = false;
      L1AttackPc l1AttackPc = new L1AttackPc(attacker, this);
      if (l1AttackPc.calcHit()) {
        L1ItemInstance weapon1 = getWeapon();
        if (hasSkillEffect(91) && weapon1.getItem().getType() == 3 && hasSkillEffect(91)) {
          boolean isShortDistance = l1AttackPc.isShortDistance();
          if (_random.nextInt(100) < ConfigKnightSkill.COUNTER_BARRIER_ROM && isShortDistance)
            isCounterBarrier = true; 
        } 
        if (!isCounterBarrier) {
          attacker.setPetTarget(this);
          l1AttackPc.calcDamage();
          l1AttackPc.calcStaffOfMana();
        } 
      } 
      if (isCounterBarrier) {
        l1AttackPc.commitCounterBarrier();
      } else {
        l1AttackPc.action();
        l1AttackPc.commit();
      } 
    } 
  }
  
  public boolean checkNonPvP(L1PcInstance pc, L1Character target) {
    L1PcInstance targetpc = null;
    if (target instanceof L1PcInstance) {
      targetpc = (L1PcInstance)target;
    } else if (target instanceof L1PetInstance) {
      targetpc = (L1PcInstance)((L1PetInstance)target).getMaster();
    } else if (target instanceof L1SummonInstance) {
      targetpc = (L1PcInstance)((L1SummonInstance)target).getMaster();
    } 
    if (targetpc == null)
      return false; 
    if (ConfigAlt.ALT_NONPVP)
      return false; 
    if (getMap().isCombatZone((Point)getLocation()))
      return false; 
    Iterator<L1War> iterator = WorldWar.get().getWarList().iterator();
    while (iterator.hasNext()) {
      L1War war = iterator.next();
      if (pc.getClanid() != 0 && targetpc.getClanid() != 0) {
        boolean same_war = war.checkClanInSameWar(pc.getClanname(), targetpc.getClanname());
        if (same_war)
          return false; 
      } 
    } 
    if (target instanceof L1PcInstance) {
      L1PcInstance targetPc = (L1PcInstance)target;
      if (isInWarAreaAndWarTime(pc, targetPc))
        return false; 
    } 
    return true;
  }
  
  private boolean isInWarAreaAndWarTime(L1PcInstance pc, L1PcInstance target) {
    int castleId = L1CastleLocation.getCastleIdByArea(pc);
    int targetCastleId = L1CastleLocation.getCastleIdByArea(target);
    return (castleId != 0 && targetCastleId != 0 && castleId == targetCastleId && 
      ServerWarExecutor.get().isNowWar(castleId));
  }
  
  public void setPetTarget(L1Character target) {
    if (target == null)
      return; 
    if (target.isDead())
      return; 
    Map<Integer, L1NpcInstance> petList = getPetList();
    try {
      if (!petList.isEmpty()) {
        Iterator<?> iter = petList.values().iterator();
        while (iter.hasNext()) {
          L1NpcInstance pet = (L1NpcInstance)iter.next();
          if (pet != null) {
            if (pet instanceof L1PetInstance) {
              L1PetInstance pets = (L1PetInstance)pet;
              pets.setMasterTarget(target);
              continue;
            } 
            if (!(pet instanceof L1SummonInstance))
              continue; 
            L1SummonInstance summon = (L1SummonInstance)pet;
            summon.setMasterTarget(target);
          } 
        } 
      } 
    } catch (Exception e) {
      if (_debug)
        _log.error(e.getLocalizedMessage(), e); 
    } 
    Map<Integer, L1IllusoryInstance> illList = get_otherList().get_illusoryList();
    try {
      if (!illList.isEmpty() && getId() != target.getId()) {
        Iterator<L1IllusoryInstance> iter2 = illList.values().iterator();
        while (iter2.hasNext()) {
          L1IllusoryInstance ill = iter2.next();
          if (ill != null)
            ill.setLink(target); 
        } 
      } 
    } catch (Exception e2) {
      if (_debug)
        _log.error(e2.getLocalizedMessage(), e2); 
    } 
  }
  
  public void delInvis() {
    if (hasSkillEffect(60)) {
      killSkillEffectTimer(60);
      sendPackets((ServerBasePacket)new S_Invis(getId(), 0));
      broadcastPacketAll((ServerBasePacket)new S_OtherCharPacks(this));
    } 
    if (hasSkillEffect(97)) {
      killSkillEffectTimer(97);
      sendPackets((ServerBasePacket)new S_Invis(getId(), 0));
      broadcastPacketAll((ServerBasePacket)new S_OtherCharPacks(this));
    } 
  }
  
  public void delBlindHiding() {
    killSkillEffectTimer(97);
    sendPackets((ServerBasePacket)new S_Invis(getId(), 0));
    broadcastPacketAll((ServerBasePacket)new S_OtherCharPacks(this));
  }
  
  public void receiveDamage(L1Character attacker, double damage, int attr) {
    int player_mr = getMr();
    int rnd = _random.nextInt(300) + 1;
    if (player_mr >= rnd)
      damage /= 2.0D; 
    int resist = 0;
    switch (attr) {
      case 1:
        resist = getEarth();
        break;
      case 2:
        resist = getFire();
        break;
      case 4:
        resist = getWater();
        break;
      case 8:
        resist = getWind();
        break;
    } 
    int resistFloor = (int)(0.32D * Math.abs(resist));
    if (resist >= 0) {
      resistFloor *= 1;
    } else {
      resistFloor *= -1;
    } 
    double attrDeffence = resistFloor / 32.0D;
    double coefficient = 1.0D - attrDeffence + 0.09375D;
    if (coefficient > 0.0D)
      damage *= coefficient; 
    receiveDamage(attacker, damage, false, false);
  }
  
  public void receiveManaDamage(L1Character attacker, int mpDamage) {
    if (mpDamage > 0 && !isDead()) {
      delInvis();
      if (attacker instanceof L1PcInstance)
        L1PinkName.onAction(this, attacker); 
      if (attacker instanceof L1PcInstance && ((L1PcInstance)attacker).isPinkName()) {
        Iterator<L1Object> iterator = World.get().getVisibleObjects((L1Object)attacker).iterator();
        while (iterator.hasNext()) {
          L1Object object = iterator.next();
          if (object instanceof L1GuardInstance) {
            L1GuardInstance guard = (L1GuardInstance)object;
            guard.setTarget((L1PcInstance)attacker);
          } 
        } 
      } 
      int newMp = getCurrentMp() - mpDamage;
      if (newMp > getMaxMp())
        newMp = getMaxMp(); 
      newMp = Math.max(newMp, 0);
      setCurrentMp(newMp);
    } 
  }
  
  public double isMagicDamager(double damage) {
    long nowTime = System.currentTimeMillis();
    long interval = nowTime - this._oldTime;
    double newdmg = 0.0D;
    if (damage < 0.0D) {
      newdmg = damage;
    } else {
      Double tmpnewdmg = _magicDamagerList.get(Long.valueOf(interval));
      if (tmpnewdmg != null) {
        newdmg = damage * tmpnewdmg.doubleValue() / 100.0D;
      } else {
        newdmg = damage;
      } 
      newdmg = Math.max(newdmg, 0.0D);
      this._oldTime = nowTime;
    } 
    return newdmg;
  }
  
  public void receiveDamage(L1Character attacker, double damage, boolean isMagicDamage, boolean isCounterBarrier) {
    if (damage <= 0.0D)
      return; 
    if (attacker == this)
      return; 
    if (getCurrentHp() > 0 && !isDead()) {
      if (attacker != null) {
        if (attacker != this && !(attacker instanceof L1EffectInstance) && !knownsObject((L1Object)attacker) && 
          attacker.getMapId() == getMapId())
          attacker.onPerceive(this); 
        if (isMagicDamage)
          damage = isMagicDamager(damage); 
        L1PcInstance attackPc = null;
        L1NpcInstance attackNpc = null;
        if (attacker instanceof L1PcInstance) {
          attackPc = (L1PcInstance)attacker;
        } else if (attacker instanceof L1NpcInstance) {
          attackNpc = (L1NpcInstance)attacker;
        } 
        if (damage > 0.0D) {
          delInvis();
          removeSkillEffect(66);
          removeSkillEffect(212);
          if (attackPc != null) {
            L1PinkName.onAction(this, attackPc);
            if (attackPc.isPinkName()) {
              Iterator<L1Object> iterator = World.get().getVisibleObjects((L1Object)attacker).iterator();
              while (iterator.hasNext()) {
                L1Object object = iterator.next();
                if (object instanceof L1GuardInstance) {
                  L1GuardInstance guard = (L1GuardInstance)object;
                  guard.setTarget((L1PcInstance)attacker);
                } 
              } 
            } 
          } 
        } 
        if (!isCounterBarrier) {
          if (hasSkillEffect(191) && getId() != attacker.getId()) {
            int rnd = _random.nextInt(100);
            if (damage > 0.0D && rnd < ConfigDragonKnightSkill.MORTAL_BODY_ROM) {
              int dmg = ConfigDragonKnightSkill.MORTAL_BODY_DMG;
              if (attackPc != null) {
                if (attackPc.hasSkillEffect(68))
                  dmg /= 2; 
                attackPc.sendPacketsAll((ServerBasePacket)new S_DoActionGFX(attackPc.getId(), 2));
                sendPacketsAll((ServerBasePacket)new S_SkillSound(getId(), 10710));
                attackPc.receiveDamage(this, dmg, false, true);
              } else if (attackNpc != null) {
                if (attackNpc.hasSkillEffect(68))
                  dmg /= 2; 
                attackNpc.getCurrentHp();
                attackNpc.broadcastPacketAll((ServerBasePacket)new S_DoActionGFX(attackNpc.getId(), 2));
                sendPacketsAll((ServerBasePacket)new S_SkillSound(getId(), 10710));
                attackNpc.receiveDamage(this, dmg);
              } 
            } 
          } 
          if (this._hades_cloak > 0) {
            int nowDamage = _random.nextInt(
                this._hades_cloak_dmgmax - this._hades_cloak_dmgmin + 1) + this._hades_cloak_dmgmin;
            if (attackPc != null && _random.nextInt(1000) < this._hades_cloak) {
              if (attackPc.hasSkillEffect(68))
                nowDamage /= 2; 
              attackPc.sendPacketsAll((ServerBasePacket)new S_DoActionGFX(attackPc.getId(), 2));
              sendPacketsAll((ServerBasePacket)new S_SkillSound(getId(), 10710));
              attackPc.receiveDamage(this, nowDamage, false, true);
            } else if (attackNpc != null && _random.nextInt(1000) < this._hades_cloak) {
              if (attackNpc.hasSkillEffect(68))
                nowDamage /= 2; 
              attackNpc.getCurrentHp();
              attackNpc.broadcastPacketAll((ServerBasePacket)new S_DoActionGFX(attackNpc.getId(), 2));
              sendPacketsAll((ServerBasePacket)new S_SkillSound(getId(), 10710));
              attackNpc.receiveDamage(this, nowDamage);
            } 
          } 
          if (has_powerid(6612)) {
            int rad = 15;
            int dmg = 80;
            if (attackPc != null && damage > 0.0D && _random.nextInt(100) < 15) {
              if (attackPc.hasSkillEffect(68))
                dmg /= 2; 
              attackPc.sendPacketsAll((ServerBasePacket)new S_DoActionGFX(attackPc.getId(), 2));
              sendPacketsAll((ServerBasePacket)new S_SkillSound(getId(), 10710));
              attackPc.receiveDamage(this, dmg, false, true);
            } else if (attackNpc != null && damage > 0.0D && _random.nextInt(100) < 15) {
              if (attackNpc.hasSkillEffect(68))
                dmg /= 2; 
              attackNpc.getCurrentHp();
              attackNpc.broadcastPacketAll((ServerBasePacket)new S_DoActionGFX(attackNpc.getId(), 2));
              sendPacketsAll((ServerBasePacket)new S_SkillSound(getId(), 10710));
              attackNpc.receiveDamage(this, dmg);
            } 
          } 
          if (attacker.hasSkillEffect(218) && getId() != attacker.getId() && !hasSkillEffect(218)) {
            int hpup = get_other().get_addhp();
            int nowDamage2 = (getMaxHp() - getCurrentHp() - hpup) / 
              ConfigIllusionstSkill.JOY_OF_PAIN_PC;
            int nowDamage3 = (getMaxHp() - getCurrentHp() - hpup) / 
              ConfigIllusionstSkill.JOY_OF_PAIN_NPC;
            if (nowDamage2 > 0) {
              if (nowDamage2 > ConfigIllusionstSkill.JOY_OF_PAIN_DMG)
                nowDamage2 = ConfigIllusionstSkill.JOY_OF_PAIN_DMG; 
              int skilltype = getlogpcpower_SkillFor1() * 100;
              if (isIllusionist() && getlogpcpower_SkillFor1() > 0)
                nowDamage2 += skilltype; 
              if (attackPc != null) {
                attackPc.sendPacketsX10((ServerBasePacket)new S_DoActionGFX(attackPc.getId(), 2));
                attackPc.receiveDamage(this, nowDamage2, false, true);
              } else if (attackNpc != null) {
                attackNpc.broadcastPacketX10((ServerBasePacket)new S_DoActionGFX(attackNpc.getId(), 2));
                attackNpc.receiveDamage(this, nowDamage3);
              } 
            } 
          } 
        } 
      } 
      if (getInventory().checkEquipped(145) || getInventory().checkEquipped(149))
        damage *= 1.5D; 
      if (hasSkillEffect(219))
        damage *= 1.0D; 
      int addmp = 0;
      if (this._elitePlateMail_Lindvior > 0 && 
        _random.nextInt(100) < this._elitePlateMail_Lindvior) {
        sendPacketsAll((ServerBasePacket)new S_SkillSound(getId(), 2188));
        addmp = _random.nextInt(this._lindvior_mpmax - this._lindvior_mpmin + 1) + 
          this._lindvior_mpmin;
        int newMp = getCurrentMp() + addmp;
        setCurrentMp(newMp);
      } 
      int addhp = 0;
      if (this._elitePlateMail_Fafurion > 0 && 
        _random.nextInt(100) < this._elitePlateMail_Fafurion) {
        sendPacketsAll((ServerBasePacket)new S_SkillSound(getId(), 2187));
        addhp = _random.nextInt(this._fafurion_hpmax - this._fafurion_hpmin + 1) + 
          this._fafurion_hpmin;
      } 
      if (this._Hexagram_Magic_Rune > 0 && _random.nextInt(1000) < this._Hexagram_Magic_Rune) {
        sendPacketsAll((ServerBasePacket)new S_SkillSound(getId(), this._hexagram_gfx));
        addhp = _random.nextInt(this._hexagram_hpmax - this._hexagram_hpmin + 1) + 
          this._hexagram_hpmin;
      } 
      if (this._dimiter_bless > 0 && _random.nextInt(1000) < this._dimiter_bless && 
        !hasSkillEffect(68)) {
        sendPacketsAll((ServerBasePacket)new S_SkillSound(getId(), 11101));
        setSkillEffect(68, this._dimiter_time * 1000);
        sendPackets((ServerBasePacket)new S_PacketBox(40, this._dimiter_time));
      } 
      if (this._dimiter_mpr_rnd > 0 && _random.nextInt(1000) < this._dimiter_mpr_rnd) {
        sendPacketsAll((ServerBasePacket)new S_SkillSound(getId(), 2188));
        addmp = _random.nextInt(this._dimiter_mpmax - this._dimiter_mpmin + 1) + 
          this._dimiter_mpmin;
        int newMp2 = getCurrentMp() + addmp;
        setCurrentMp(newMp2);
      } 
      if (isKnight() && isEsoteric() && damage > 0.0D) {
        int mp = (int)(damage * 5.0D / getlogpcpower_SkillFor3());
        if (getCurrentMp() > mp) {
          int newMp3 = getCurrentMp() - mp;
          if (newMp3 > (short)getMaxMp())
            newMp3 = (short)getMaxMp(); 
          if (newMp3 <= 0)
            newMp3 = 1; 
          setCurrentMp(newMp3);
          damage = 0.0D;
          sendPackets((ServerBasePacket)new S_SkillSound(getId(), 214));
          broadcastPacketAll((ServerBasePacket)new S_SkillSound(getId(), 214));
        } else {
          setEsoteric(false);
          sendPackets((ServerBasePacket)new S_SystemMessage("\\fU关闭转身技能(圣法之盾)"));
        } 
      } 
      if (isKnight() && getlogpcpower_SkillFor5() != 0) {
        boolean isSameAttr = false;
        if (getHeading() == 0 && (
          attacker.getHeading() == 3 || attacker.getHeading() == 4 || attacker.getHeading() == 4)) {
          isSameAttr = true;
        } else if (getHeading() == 1 && (
          attacker.getHeading() == 4 || attacker.getHeading() == 5 || attacker.getHeading() == 6)) {
          isSameAttr = true;
        } else if (getHeading() == 2 && (
          attacker.getHeading() == 5 || attacker.getHeading() == 6 || attacker.getHeading() == 7)) {
          isSameAttr = true;
        } else if (getHeading() == 3 && (
          attacker.getHeading() == 6 || attacker.getHeading() == 7 || attacker.getHeading() == 0)) {
          isSameAttr = true;
        } else if (getHeading() == 4 && (
          attacker.getHeading() == 7 || attacker.getHeading() == 0 || attacker.getHeading() == 1)) {
          isSameAttr = true;
        } else if (getHeading() == 5 && (
          attacker.getHeading() == 0 || attacker.getHeading() == 1 || attacker.getHeading() == 2)) {
          isSameAttr = true;
        } else if (getHeading() == 6 && (
          attacker.getHeading() == 1 || attacker.getHeading() == 2 || attacker.getHeading() == 3)) {
          isSameAttr = true;
        } else if (getHeading() == 7 && (
          attacker.getHeading() == 2 || attacker.getHeading() == 3 || attacker.getHeading() == 4)) {
          isSameAttr = true;
        } 
        if (isSameAttr && RandomArrayList.getInc(100, 1) <= getlogpcpower_SkillFor5()) {
          damage *= 0.7D;
          sendPackets((ServerBasePacket)new S_SkillSound(getId(), 5377));
          sendPackets((ServerBasePacket)new S_SystemMessage("触发 神圣壁垒 减免了 30%伤害。"));
        } 
      } 
      int newHp = getCurrentHp() - (int)damage + addhp;
      if (newHp > getMaxHp())
        newHp = getMaxHp(); 
      if (newHp <= 0 && !isGm())
        death(attacker); 
      setCurrentHp(newHp);
    } else if (!isDead()) {
      _log.error("人物hp减少处理失败 可能原因: 初始hp为0");
      death(attacker);
    } 
  }
  
  public void death(L1Character lastAttacker) {
    synchronized (this) {
      if (isDead())
        return; 
      setNowTarget((L1Character)null);
      setDead(true);
      setStatus(8);
      if (isActived()) {
        setActived(false);
        sendPackets((ServerBasePacket)new S_ServerMessage("自动狩猎已停止了。"));
        if (get_fwgj() > 0) {
          setlslocx(0);
          setlslocy(0);
          set_fwgj(0);
          killSkillEffectTimer(8853);
        } 
      } 
    } 
    GeneralThreadPool.get().execute(new Death(lastAttacker));
  }
  
  private void caoPenaltyResult(int count) {
    int i = 0;
    while (i < count) {
      L1ItemInstance item = getInventory().caoPenalty();
      if (item != null) {
        if (item.isSeal()) {
          sendPackets((ServerBasePacket)new S_SystemMessage("\\aL死亡触发掉落:" + item.getLogName() + "但是它被绑定保护了!"));
          continue;
        } 
        if (ItemdropdeadTable.RESTRICTIONS.contains(Integer.valueOf(item.getItemId()))) {
          _log.warn(
              "玩家：" + getName() + "装备 死亡喷出遗失:" + item.getId() + "/" + item.getItem().getName());
          getInventory().deleteItem(item);
          bowisbuy("玩家【 " + getName() + " 】的" + "【 + " + item.getEnchantLevel() + " " + item.getName() + 
              " 】在死亡时(设定强制)消失了，" + "时间:(" + new Timestamp(System.currentTimeMillis()) + ")。");
          sendPackets((ServerBasePacket)new S_ServerMessage(638, item.getLogName()));
          if (ConfigOther.DropitemMsgall)
            World.get().broadcastPacketToAll((ServerBasePacket)new S_ServerMessage(
                  "玩家[" + getName() + "]死亡,东西[" + item.getLogName() + "]喷在地上并强制删除")); 
        } else if (item.getBless() >= 128) {
          _log.warn(
              "玩家：" + getName() + "封印装备 死亡喷出遗失:" + item.getId() + "/" + item.getItem().getName());
          getInventory().deleteItem(item);
          bowisbuy(
              "玩家【 " + getName() + " 】的(封印)" + "【 + " + item.getEnchantLevel() + " " + item.getName() + 
              " 】在死亡时消失了，" + "时间:(" + new Timestamp(System.currentTimeMillis()) + ")。");
          sendPackets((ServerBasePacket)new S_ServerMessage(638, item.getLogName()));
          if (ConfigOther.DropitemMsgall)
            World.get().broadcastPacketToAll(
                (ServerBasePacket)new S_ServerMessage("玩家[" + getName() + "]死亡,东西[" + item.getLogName() + "]喷在地上了")); 
        } else {
          if (ConfigOther.DropitemMsgall)
            World.get().broadcastPacketToAll(
                (ServerBasePacket)new S_ServerMessage("玩家[" + getName() + "]死亡,东西[" + item.getLogName() + "]喷在地上了")); 
          bowisbuy("玩家【 " + getName() + " 】的" + "【 + " + item.getEnchantLevel() + " " + item.getName() + 
              " 】在死亡喷出，" + "时间:(" + new Timestamp(System.currentTimeMillis()) + ")。");
          _log
            .warn("玩家：" + getName() + "死亡喷出物品:" + item.getId() + "/" + item.getItem().getName());
          item.set_showId(get_showId());
          int x = getX();
          int y = getY();
          short m = getMapId();
          getInventory().tradeItem(item, item.isStackable() ? item.getCount() : 1L, 
              (L1Inventory)World.get().getInventory(x, y, m));
        } 
        sendPackets((ServerBasePacket)new S_ServerMessage(638, item.getLogName()));
        World.addpcFallingItemObjIdList(item);
        RecordTable.get().recordeDeadItem(getName(), item.getAllName(), (int)item.getCount(), 
            item.getId(), getIp());
      } 
      i++;
    } 
  }
  
  public void stopPcDeleteTimer() {
    setDead(false);
    set_delete_time(0);
  }
  
  public boolean castleWarResult() {
    if (getClanid() != 0 && isCrown()) {
      L1Clan clan = WorldClan.get().getClan(getClanname());
      if (clan.getCastleId() == 0) {
        Iterator<L1War> iterator = WorldWar.get().getWarList().iterator();
        while (iterator.hasNext()) {
          L1War war = iterator.next();
          int warType = war.getWarType();
          boolean isInWar = war.checkClanInWar(getClanname());
          boolean isAttackClan = war.checkAttackClan(getClanname());
          if (getId() == clan.getLeaderId() && warType == 1 && isInWar && isAttackClan) {
            String enemyClanName = war.getEnemyClanName(getClanname());
            if (enemyClanName != null)
              war.ceaseWar(getClanname(), enemyClanName); 
            break;
          } 
        } 
      } 
    } 
    int castleId = 0;
    boolean isNowWar = false;
    castleId = L1CastleLocation.getCastleIdByArea(this);
    if (castleId != 0)
      isNowWar = ServerWarExecutor.get().isNowWar(castleId); 
    return isNowWar;
  }
  
  public boolean simWarResult(L1Character lastAttacker) {
    if (getClanid() == 0)
      return false; 
    L1PcInstance attacker = null;
    String enemyClanName = null;
    boolean sameWar = false;
    if (lastAttacker instanceof L1PcInstance) {
      attacker = (L1PcInstance)lastAttacker;
    } else if (lastAttacker instanceof L1PetInstance) {
      attacker = (L1PcInstance)((L1PetInstance)lastAttacker).getMaster();
    } else if (lastAttacker instanceof L1SummonInstance) {
      attacker = (L1PcInstance)((L1SummonInstance)lastAttacker).getMaster();
    } else if (lastAttacker instanceof L1IllusoryInstance) {
      attacker = (L1PcInstance)((L1IllusoryInstance)lastAttacker).getMaster();
    } else {
      if (!(lastAttacker instanceof L1EffectInstance))
        return false; 
      attacker = (L1PcInstance)((L1EffectInstance)lastAttacker).getMaster();
    } 
    L1Clan clan = WorldClan.get().getClan(getClanname());
    Iterator<L1War> iterator = WorldWar.get().getWarList().iterator();
    while (iterator.hasNext()) {
      L1War war = iterator.next();
      int warType = war.getWarType();
      if (warType != 1) {
        boolean isInWar = war.checkClanInWar(getClanname());
        if (!isInWar)
          continue; 
        if (attacker != null && attacker.getClanid() != 0)
          sameWar = war.checkClanInSameWar(getClanname(), attacker.getClanname()); 
        if (getId() == clan.getLeaderId()) {
          enemyClanName = war.getEnemyClanName(getClanname());
          if (enemyClanName != null)
            war.ceaseWar(getClanname(), enemyClanName); 
        } 
        if (warType == 2 && sameWar)
          return true; 
      } 
    } 
    return false;
  }
  
  public void resExp() {
    int oldLevel = getLevel();
    long needExp = ExpTable.getNeedExpNextLevel(oldLevel);
    long exp = 0L;
    switch (oldLevel) {
      case 1:
      case 2:
      case 3:
      case 4:
      case 5:
      case 6:
      case 7:
      case 8:
      case 9:
      case 10:
      case 11:
      case 12:
      case 13:
      case 14:
      case 15:
      case 16:
      case 17:
      case 18:
      case 19:
      case 20:
      case 21:
      case 22:
      case 23:
      case 24:
      case 25:
      case 26:
      case 27:
      case 28:
      case 29:
      case 30:
      case 31:
      case 32:
      case 33:
      case 34:
      case 35:
      case 36:
      case 37:
      case 38:
      case 39:
      case 40:
      case 41:
      case 42:
      case 43:
      case 44:
        exp = (long)(needExp * 0.05D);
        break;
      case 45:
        exp = (long)(needExp * 0.045D);
        break;
      case 46:
        exp = (long)(needExp * 0.04D);
        break;
      case 47:
        exp = (long)(needExp * 0.035D);
        break;
      case 48:
        exp = (long)(needExp * 0.03D);
        break;
      case 49:
      case 50:
      case 51:
      case 52:
      case 53:
      case 54:
      case 55:
      case 56:
      case 57:
      case 58:
      case 59:
      case 60:
      case 61:
      case 62:
      case 63:
      case 64:
      case 65:
      case 66:
      case 67:
      case 68:
      case 69:
      case 70:
      case 71:
      case 72:
      case 73:
      case 74:
      case 75:
      case 76:
      case 77:
      case 78:
      case 79:
      case 80:
      case 81:
      case 82:
      case 83:
      case 84:
      case 85:
      case 86:
      case 87:
      case 88:
      case 89:
        exp = (long)(needExp * 0.025D);
        break;
      default:
        exp = (long)(needExp * 0.025D);
        break;
    } 
    if (exp == 0L)
      return; 
    addExp(exp);
  }
  
  private long deathPenalty() {
    int oldLevel = getLevel();
    long needExp = ExpTable.getNeedExpNextLevel(oldLevel);
    long exp = 0L;
    switch (oldLevel) {
      case 1:
      case 2:
      case 3:
      case 4:
      case 5:
      case 6:
      case 7:
      case 8:
      case 9:
      case 10:
        exp = 0L;
        break;
      case 11:
      case 12:
      case 13:
      case 14:
      case 15:
      case 16:
      case 17:
      case 18:
      case 19:
      case 20:
      case 21:
      case 22:
      case 23:
      case 24:
      case 25:
      case 26:
      case 27:
      case 28:
      case 29:
      case 30:
      case 31:
      case 32:
      case 33:
      case 34:
      case 35:
      case 36:
      case 37:
      case 38:
      case 39:
      case 40:
      case 41:
      case 42:
      case 43:
      case 44:
        exp = (long)(needExp * 0.1D);
        break;
      case 45:
        exp = (long)(needExp * 0.09D);
        break;
      case 46:
        exp = (long)(needExp * 0.08D);
        break;
      case 47:
        exp = (long)(needExp * 0.07D);
        break;
      case 48:
        exp = (long)(needExp * 0.06D);
        break;
      case 49:
        exp = (long)(needExp * 0.05D);
        break;
      default:
        exp = (long)(needExp * 0.05D);
        break;
    } 
    if (exp == 0L)
      return 0L; 
    addExp(-exp);
    return exp;
  }
  
  public int getOriginalEr() {
    return this._originalEr;
  }
  
  public int getEr() {
    if (hasSkillEffect(174))
      return 0; 
    int er = 0;
    if (isKnight()) {
      er = getLevel() >> 2;
    } else if (isCrown() || isElf()) {
      er = getLevel() >> 3;
    } else if (isDarkelf()) {
      er = getLevel() / 6;
    } else if (isWizard()) {
      er = getLevel() / 10;
    } else if (isDragonKnight()) {
      er = getLevel() / 7;
    } else if (isIllusionist()) {
      er = getLevel() / 9;
    } 
    er += getDex() - 8 >> 1;
    er += getOriginalEr();
    er += getAdd_Er();
    if (hasSkillEffect(111))
      er += 12; 
    if (hasSkillEffect(90))
      er += 15; 
    return er;
  }
  
  public L1ItemInstance getWeapon() {
    return this._weapon;
  }
  
  public void setWeapon(L1ItemInstance weapon) {
    this._weapon = weapon;
  }
  
  public L1PcQuest getQuest() {
    return this._quest;
  }
  
  public L1ActionPc getAction() {
    return this._action;
  }
  
  public L1ActionPet getActionPet() {
    return this._actionPet;
  }
  
  public L1ActionSummon getActionSummon() {
    return this._actionSummon;
  }
  
  public boolean isCrown() {
    return !(getClassId() != 0 && getClassId() != 1);
  }
  
  public boolean isKnight() {
    return !(getClassId() != 61 && getClassId() != 48);
  }
  
  public boolean isElf() {
    return !(getClassId() != 138 && getClassId() != 37);
  }
  
  public boolean isWizard() {
    return !(getClassId() != 734 && getClassId() != 1186);
  }
  
  public boolean isDarkelf() {
    return !(getClassId() != 2786 && getClassId() != 2796);
  }
  
  public boolean isDragonKnight() {
    return !(getClassId() != 6658 && getClassId() != 6661);
  }
  
  public boolean isIllusionist() {
    return !(getClassId() != 6671 && getClassId() != 6650);
  }
  
  public String getAccountName() {
    return this._accountName;
  }
  
  public void setAccountName(String s) {
    this._accountName = s;
  }
  
  public short getBaseMaxHp() {
    return this._baseMaxHp;
  }
  
  public void addBaseMaxHp(short i) {
    i = (short)(i + this._baseMaxHp);
    if (i >= Short.MAX_VALUE) {
      i = Short.MAX_VALUE;
    } else if (i < 1) {
      i = 1;
    } 
    addMaxHp(i - this._baseMaxHp);
    this._baseMaxHp = i;
  }
  
  public short getBaseMaxMp() {
    return this._baseMaxMp;
  }
  
  public void addBaseMaxMp(short i) {
    i = (short)(i + this._baseMaxMp);
    if (i >= Short.MAX_VALUE) {
      i = Short.MAX_VALUE;
    } else if (i < 1) {
      i = 1;
    } 
    addMaxMp(i - this._baseMaxMp);
    this._baseMaxMp = i;
  }
  
  public int getBaseAc() {
    return this._baseAc;
  }
  
  public int getOriginalAc() {
    return this._originalAc;
  }
  
  public int getBaseStr() {
    return this._baseStr;
  }
  
  public void addBaseStr(int i) {
    i += this._baseStr;
    if (i >= 254) {
      i = 254;
    } else if (i < 1) {
      i = 1;
    } 
    addStr(i - this._baseStr);
    this._baseStr = i;
  }
  
  public int getBaseCon() {
    return this._baseCon;
  }
  
  public void addBaseCon(int i) {
    i += this._baseCon;
    if (i >= 254) {
      i = 254;
    } else if (i < 1) {
      i = 1;
    } 
    addCon(i - this._baseCon);
    this._baseCon = i;
  }
  
  public int getBaseDex() {
    return this._baseDex;
  }
  
  public void addBaseDex(int i) {
    i += this._baseDex;
    if (i >= 254) {
      i = 254;
    } else if (i < 1) {
      i = 1;
    } 
    addDex(i - this._baseDex);
    this._baseDex = i;
  }
  
  public int getBaseCha() {
    return this._baseCha;
  }
  
  public void addBaseCha(int i) {
    i += this._baseCha;
    if (i >= 254) {
      i = 254;
    } else if (i < 1) {
      i = 1;
    } 
    addCha(i - this._baseCha);
    this._baseCha = i;
  }
  
  public int getBaseInt() {
    return this._baseInt;
  }
  
  public void addBaseInt(int i) {
    i += this._baseInt;
    if (i >= 254) {
      i = 254;
    } else if (i < 1) {
      i = 1;
    } 
    addInt(i - this._baseInt);
    this._baseInt = i;
  }
  
  public int getBaseWis() {
    return this._baseWis;
  }
  
  public void addBaseWis(int i) {
    i += this._baseWis;
    if (i >= 254) {
      i = 254;
    } else if (i < 1) {
      i = 1;
    } 
    addWis(i - this._baseWis);
    this._baseWis = i;
  }
  
  public int getOriginalStr() {
    return this._originalStr;
  }
  
  public void setOriginalStr(int i) {
    this._originalStr = i;
  }
  
  public int getOriginalCon() {
    return this._originalCon;
  }
  
  public void setOriginalCon(int i) {
    this._originalCon = i;
  }
  
  public int getOriginalDex() {
    return this._originalDex;
  }
  
  public void setOriginalDex(int i) {
    this._originalDex = i;
  }
  
  public int getOriginalCha() {
    return this._originalCha;
  }
  
  public void setOriginalCha(int i) {
    this._originalCha = i;
  }
  
  public int getOriginalInt() {
    return this._originalInt;
  }
  
  public void setOriginalInt(int i) {
    this._originalInt = i;
  }
  
  public int getOriginalWis() {
    return this._originalWis;
  }
  
  public void setOriginalWis(int i) {
    this._originalWis = i;
  }
  
  public int getOriginalDmgup() {
    return this._originalDmgup;
  }
  
  public int getOriginalBowDmgup() {
    return this._originalBowDmgup;
  }
  
  public int getOriginalHitup() {
    return this._originalHitup;
  }
  
  public int getOriginalBowHitup() {
    return this._originalHitup + this._originalBowHitup;
  }
  
  public int getOriginalMr() {
    return this._originalMr;
  }
  
  public void addOriginalMagicHit(int i) {
    this._originalMagicHit += i;
  }
  
  public int getOriginalMagicHit() {
    return this._originalMagicHit;
  }
  
  public void addOriginalMagicCritical(int i) {
    this._originalMagicCritical += i;
  }
  
  public int getOriginalMagicCritical() {
    return this._originalMagicCritical;
  }
  
  public int getOriginalMagicConsumeReduction() {
    return this._originalMagicConsumeReduction;
  }
  
  public int getOriginalMagicDamage() {
    return this._originalMagicDamage;
  }
  
  public int getOriginalHpup() {
    return this._originalHpup;
  }
  
  public int getOriginalMpup() {
    return this._originalMpup;
  }
  
  public int getBaseDmgup() {
    return this._baseDmgup;
  }
  
  public int getBaseBowDmgup() {
    return this._baseBowDmgup;
  }
  
  public int getBaseHitup() {
    return this._baseHitup;
  }
  
  public int getBaseBowHitup() {
    return this._baseBowHitup;
  }
  
  public int getBaseMr() {
    return this._baseMr;
  }
  
  public int getAdvenHp() {
    return this._advenHp;
  }
  
  public void setAdvenHp(int i) {
    this._advenHp = i;
  }
  
  public int getAdvenMp() {
    return this._advenMp;
  }
  
  public void setAdvenMp(int i) {
    this._advenMp = i;
  }
  
  public int getHighLevel() {
    return this._highLevel;
  }
  
  public void setHighLevel(int i) {
    this._highLevel = i;
  }
  
  public int getBonusStats() {
    return this._bonusStats;
  }
  
  public void setBonusStats(int i) {
    this._bonusStats = i;
  }
  
  public int getElixirStats() {
    return this._elixirStats;
  }
  
  public void setElixirStats(int i) {
    this._elixirStats = i;
  }
  
  public int getElfAttr() {
    return this._elfAttr;
  }
  
  public void setElfAttr(int i) {
    this._elfAttr = i;
  }
  
  public int getExpRes() {
    return this._expRes;
  }
  
  public void setExpRes(int i) {
    this._expRes = i;
  }
  
  public int getPartnerId() {
    return this._partnerId;
  }
  
  public void setPartnerId(int i) {
    this._partnerId = i;
  }
  
  public int getOnlineStatus() {
    return this._onlineStatus;
  }
  
  public void setOnlineStatus(int i) {
    this._onlineStatus = i;
  }
  
  public int getHomeTownId() {
    return this._homeTownId;
  }
  
  public void setHomeTownId(int i) {
    this._homeTownId = i;
  }
  
  public int getContribution() {
    return this._contribution;
  }
  
  public void setContribution(int i) {
    this._contribution = i;
  }
  
  public int getPay() {
    return this._pay;
  }
  
  public void setPay(int i) {
    this._pay = i;
  }
  
  public int getHellTime() {
    return this._hellTime;
  }
  
  public void setHellTime(int i) {
    this._hellTime = i;
  }
  
  public boolean isBanned() {
    return this._banned;
  }
  
  public void setBanned(boolean flag) {
    this._banned = flag;
  }
  
  public int get_food() {
    return this._food;
  }
  
  public void set_food(int i) {
    if (i > 225) {
      i = 225;
    } else if (i < 0) {
      i = 0;
    } 
    this._food = i;
    if (this._food == 225) {
      Calendar cal = Calendar.getInstance();
      long h_time = cal.getTimeInMillis() / 1000L;
      set_h_time(h_time);
    } else {
      set_h_time(-1L);
    } 
  }
  
  public L1EquipmentSlot getEquipSlot() {
    return this._equipSlot;
  }
  
  public void save() throws Exception {
    if (isGhost())
      return; 
    if (isInCharReset())
      return; 
    if (this._other != null)
      CharOtherReading.get().storeOther(getId(), this._other); 
    if (this._other1 != null)
      CharOtherReading1.get().storeOther(getId(), this._other1); 
    if (this._other2 != null)
      CharOtherReading2.get().storeOther(getId(), this._other2); 
    if (this._other3 != null)
      CharOtherReading3.get().storeOther(getId(), this._other3); 
    CharacterTable.get().storeCharacter(this);
  }
  
  public void saveInventory() {
    Iterator<L1ItemInstance> iterator = getInventory().getItems().iterator();
    while (iterator.hasNext()) {
      L1ItemInstance item = iterator.next();
      getInventory().saveItem(item, item.getRecordingColumns());
    } 
  }
  
  public double getMaxWeight() {
    int str = getStr();
    int con = getCon();
    double maxWeight = 150.0D * Math.floor(0.6D * str + 0.4D * con + 1.0D) * get_weightUP();
    double weightReductionByArmor = getWeightReduction();
    weightReductionByArmor /= 100.0D;
    int weightReductionByMagic = 0;
    if (hasSkillEffect(14) || hasSkillEffect(218))
      weightReductionByMagic = 180; 
    double originalWeightReduction = 0.0D;
    originalWeightReduction += 0.04D * (getOriginalStrWeightReduction() + getOriginalConWeightReduction());
    double weightReduction = 1.0D + weightReductionByArmor + originalWeightReduction;
    maxWeight *= weightReduction;
    maxWeight += weightReductionByMagic;
    maxWeight *= ConfigRate.RATE_WEIGHT_LIMIT;
    return maxWeight;
  }
  
  public boolean isRibrave() {
    return hasSkillEffect(1017);
  }
  
  public boolean isFastMovable() {
    return !(!hasSkillEffect(52) && !hasSkillEffect(101) && !hasSkillEffect(150) && 
      !hasSkillEffect(1017));
  }
  
  public boolean isFastAttackable() {
    return false;
  }
  
  public boolean isBrave() {
    return hasSkillEffect(1000);
  }
  
  public boolean isElfBrave() {
    return hasSkillEffect(1016);
  }
  
  public boolean isBraveX() {
    return hasSkillEffect(998);
  }
  
  public boolean isHaste() {
    return !(!hasSkillEffect(1001) && !hasSkillEffect(43) && !hasSkillEffect(54) && 
      getMoveSpeed() != 1);
  }
  
  public boolean isInvisDelay() {
    return (this.invisDelayCounter > 0);
  }
  
  public void addInvisDelayCounter(int counter) {
    synchronized (this._invisTimerMonitor) {
      this.invisDelayCounter += counter;
    } 
  }
  
  public void beginInvisTimer() {
    addInvisDelayCounter(1);
    GeneralThreadPool.get().pcSchedule((L1PcMonitor)new L1PcInvisDelay(getId()), 3000L);
  }
  
  public synchronized void addLawful(int i) {
    int lawful = getLawful() + i;
    if (lawful > 32767) {
      lawful = 32767;
    } else if (lawful < -32768) {
      lawful = -32768;
    } 
    setLawful(lawful);
  }
  
  public synchronized void addExp(long exp) {
    long newexp = this._exp + exp;
    if (!isAddExp(newexp))
      return; 
    setExp(newexp);
  }
  
  private boolean isAddExp(long exp) {
    int level = ConfigOther.PcLevelUp + 1;
    long maxExp = ExpTable.getExpByLevel(level) - 44L;
    if (exp >= maxExp) {
      this._exp = maxExp;
      return false;
    } 
    return true;
  }
  
  public synchronized void addContribution(int contribution) {
    this._contribution += contribution;
  }
  
  private void levelUp(int gap) {
    resetLevel();
    int i = 0;
    while (i < gap) {
      short randomHp = CalcStat.calcStatHp(getType(), getBaseMaxHp(), getBaseCon(), 
          getOriginalHpup());
      short randomMp = CalcStat.calcStatMp(getType(), getBaseMaxMp(), getBaseWis(), 
          getOriginalMpup());
      addBaseMaxHp(randomHp);
      addBaseMaxMp(randomMp);
      i++;
    } 
    if (ConfigOther.logpcgiveitem && getLevel() >= ConfigOther.logpclevel)
      try {
        L1Item l1item = ItemTable.get().getTemplate(43000);
        if (l1item != null && getInventory().checkAddItem(l1item, 1L) == 0) {
          getInventory().storeItem(43000, 1L);
          sendPackets((ServerBasePacket)new S_ServerMessage(403, l1item.getName()));
        } else {
          sendPackets((ServerBasePacket)new S_SystemMessage("无法获得转生药水。可能此道具不存在！"));
        } 
      } catch (Exception e) {
        sendPackets((ServerBasePacket)new S_SystemMessage("无法获得转生药水。可能此道具不存在！"));
      }  
    resetBaseHitup();
    resetBaseDmgup();
    resetBaseAc();
    resetBaseMr();
    if (getLevel() > getHighLevel())
      setHighLevel(getLevel()); 
    setCurrentHp(getMaxHp());
    setCurrentMp(getMaxMp());
    try {
      save();
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
      return;
    } finally {
      getApprentice();
      sendPackets((ServerBasePacket)new S_OwnCharStatus(this));
      Reward.getItem(this);
      Reward1.getItem(this);
      if (lvgiveitemcount.START)
        L1WilliamLimitedReward.check_Task_For_Level(this); 
      MapLevelTable.get().get_level(getMapId(), this);
      showWindows();
      if (Addskill.START)
        AutoAddSkillTable.get().forAutoAddSkill(this); 
      if (ConfigOther.newcharpra && getnewcharpra() && getLevel() >= ConfigOther.newcharpralv) {
        setnewcharpra(false);
        sendPackets((ServerBasePacket)new S_ServerMessage("您的等级已达新手保护机制。"));
      } 
    } 
  }
  
  public void showWindows() {
    if (power())
      if (getMeteLevel() > 0 && ConfigOther.logpcpower) {
        sendPackets((ServerBasePacket)new S_Bonusstats(getId()));
      } else if (getMeteLevel() == 0) {
        sendPackets((ServerBasePacket)new S_Bonusstats(getId()));
      }  
  }
  
  public void isWindows() {
    if (power()) {
      sendPackets((ServerBasePacket)new S_NPCTalkReturn(getId(), "y_qs_10"));
    } else {
      sendPackets((ServerBasePacket)new S_NPCTalkReturn(getId(), "y_qs_00"));
    } 
  }
  
  public boolean power() {
    if (getLevel() >= 51 && getLevel() - 50 > getBonusStats()) {
      int power = getBaseStr() + getBaseDex() + getBaseCon() + getBaseInt() + 
        getBaseWis() + getBaseCha();
      if (power < ConfigAlt.POWER * 6)
        return true; 
    } 
    return false;
  }
  
  private void levelDown(int gap) {
    resetLevel();
    int i = 0;
    while (i > gap) {
      short randomHp = CalcStat.calcStatHp(getType(), 0, getBaseCon(), getOriginalHpup());
      short randomMp = CalcStat.calcStatMp(getType(), 0, getBaseWis(), getOriginalMpup());
      addBaseMaxHp((short)-randomHp);
      addBaseMaxMp((short)-randomMp);
      i--;
    } 
    if (getLevel() == 1) {
      int initHp = CalcInitHpMp.calcInitHp(this);
      int initMp = CalcInitHpMp.calcInitMp(this);
      addBaseMaxHp((short)-getBaseMaxHp());
      addBaseMaxHp((short)initHp);
      setCurrentHp((short)initHp);
      addBaseMaxMp((short)-getBaseMaxMp());
      addBaseMaxMp((short)initMp);
      setCurrentMp((short)initMp);
    } 
    resetBaseHitup();
    resetBaseDmgup();
    resetBaseAc();
    resetBaseMr();
    getApprentice();
    try {
      save();
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
    } finally {
      sendPackets((ServerBasePacket)new S_OwnCharStatus(this));
      MapLevelTable.get().get_level(getMapId(), this);
    } 
  }
  
  public boolean isGhost() {
    return this._ghost;
  }
  
  private void setGhost(boolean flag) {
    this._ghost = flag;
  }
  
  public int get_ghostTime() {
    return this._ghostTime;
  }
  
  public void set_ghostTime(int ghostTime) {
    this._ghostTime = ghostTime;
  }
  
  public boolean isGhostCanTalk() {
    return this._ghostCanTalk;
  }
  
  private void setGhostCanTalk(boolean flag) {
    this._ghostCanTalk = flag;
  }
  
  public boolean isReserveGhost() {
    return this._isReserveGhost;
  }
  
  public void setReserveGhost(boolean flag) {
    this._isReserveGhost = flag;
  }
  
  public void beginGhost(int locx, int locy, short mapid, boolean canTalk) {
    beginGhost(locx, locy, mapid, canTalk, 0);
  }
  
  public void beginGhost(int locx, int locy, short mapid, boolean canTalk, int sec) {
    if (isGhost())
      return; 
    setGhost(true);
    this._ghostSaveLocX = getX();
    this._ghostSaveLocY = getY();
    this._ghostSaveMapId = getMapId();
    this._ghostSaveHeading = getHeading();
    setGhostCanTalk(canTalk);
    L1Teleport.teleport(this, locx, locy, mapid, 5, true);
    if (sec > 0)
      set_ghostTime(sec * 1000); 
  }
  
  public void makeReadyEndGhost() {
    setReserveGhost(true);
    L1Teleport.teleport(this, this._ghostSaveLocX, this._ghostSaveLocY, this._ghostSaveMapId, 
        this._ghostSaveHeading, true);
  }
  
  public void makeReadyEndGhost(boolean effectble) {
    setReserveGhost(true);
    L1Teleport.teleport(this, this._ghostSaveLocX, this._ghostSaveLocY, this._ghostSaveMapId, 
        this._ghostSaveHeading, effectble);
  }
  
  public void endGhost() {
    set_ghostTime(-1);
    setGhost(false);
    setGhostCanTalk(true);
    setReserveGhost(false);
  }
  
  public void beginHell(boolean isFirst) {
    if (getMapId() != 666) {
      int locx = 32701;
      int locy = 32777;
      short mapid = 666;
      L1Teleport.teleport(this, 32701, 32777, (short)666, 5, false);
    } 
    if (isFirst) {
      if (get_PKcount() <= 10) {
        setHellTime(180);
      } else {
        setHellTime(180);
      } 
      sendPackets((ServerBasePacket)new S_BlueMessage(552, String.valueOf(get_PKcount()), 
            String.valueOf(getHellTime() / 60)));
    } else {
      sendPackets((ServerBasePacket)new S_BlueMessage(637, String.valueOf(getHellTime())));
    } 
  }
  
  public void endHell() {
    int[] loc = L1TownLocation.getGetBackLoc(4);
    L1Teleport.teleport(this, loc[0], loc[1], (short)loc[2], 5, true);
    try {
      save();
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
    } 
  }
  
  public void setPoisonEffect(int effectId) {
    sendPackets((ServerBasePacket)new S_Poison(getId(), effectId));
    if (!isGmInvis() && !isGhost() && !isInvisble())
      broadcastPacketAll((ServerBasePacket)new S_Poison(getId(), effectId)); 
  }
  
  public void healHp(int pt) {
    super.healHp(pt);
    sendPackets((ServerBasePacket)new S_HPUpdate(this));
  }
  
  public int getKarma() {
    return this._karma.get();
  }
  
  public void setKarma(int i) {
    this._karma.set(i);
  }
  
  public void addKarma(int i) {
    synchronized (this._karma) {
      this._karma.add(i);
      onChangeKarma();
    } 
  }
  
  public int getKarmaLevel() {
    return this._karma.getLevel();
  }
  
  public int getKarmaPercent() {
    return this._karma.getPercent();
  }
  
  public Timestamp getLastPk() {
    return this._lastPk;
  }
  
  public void setLastPk(Timestamp time) {
    this._lastPk = time;
  }
  
  public void setLastPk() {
    this._lastPk = new Timestamp(System.currentTimeMillis());
  }
  
  public boolean isWanted() {
    if (this._lastPk == null)
      return false; 
    if (System.currentTimeMillis() - this._lastPk.getTime() > 3600000L) {
      setLastPk((Timestamp)null);
      return false;
    } 
    return true;
  }
  
  public Timestamp getLastPkForElf() {
    return this._lastPkForElf;
  }
  
  public void setLastPkForElf(Timestamp time) {
    this._lastPkForElf = time;
  }
  
  public void setLastPkForElf() {
    this._lastPkForElf = new Timestamp(System.currentTimeMillis());
  }
  
  public boolean isWantedForElf() {
    if (this._lastPkForElf == null)
      return false; 
    if (System.currentTimeMillis() - this._lastPkForElf.getTime() > 86400000L) {
      setLastPkForElf((Timestamp)null);
      return false;
    } 
    return true;
  }
  
  public Timestamp getDeleteTime() {
    return this._deleteTime;
  }
  
  public void setDeleteTime(Timestamp time) {
    this._deleteTime = time;
  }
  
  public int getMagicLevel() {
    return getClassFeature().getMagicLevel(getLevel());
  }
  
  public double get_weightUP() {
    return this._weightUP;
  }
  
  public void add_weightUP(int i) {
    this._weightUP += i / 100.0D;
  }
  
  public int getWeightReduction() {
    return this._weightReduction;
  }
  
  public void addWeightReduction(int i) {
    this._weightReduction += i;
  }
  
  public int getOriginalStrWeightReduction() {
    return this._originalStrWeightReduction;
  }
  
  public int getOriginalConWeightReduction() {
    return this._originalConWeightReduction;
  }
  
  public int getHasteItemEquipped() {
    return this._hasteItemEquipped;
  }
  
  public void addHasteItemEquipped(int i) {
    this._hasteItemEquipped += i;
  }
  
  public void removeHasteSkillEffect() {
    if (hasSkillEffect(29))
      removeSkillEffect(29); 
    if (hasSkillEffect(76))
      removeSkillEffect(76); 
    if (hasSkillEffect(152))
      removeSkillEffect(152); 
    if (hasSkillEffect(43))
      removeSkillEffect(43); 
    if (hasSkillEffect(54))
      removeSkillEffect(54); 
    if (hasSkillEffect(1001))
      removeSkillEffect(1001); 
  }
  
  public int getDamageReductionByArmor() {
    return this._damageReductionByArmor;
  }
  
  public void addDamageReductionByArmor(int i) {
    this._damageReductionByArmor += i;
  }
  
  public int getHitModifierByArmor() {
    return this._hitModifierByArmor;
  }
  
  public void addHitModifierByArmor(int i) {
    this._hitModifierByArmor += i;
  }
  
  public int getDmgModifierByArmor() {
    return this._dmgModifierByArmor;
  }
  
  public void addDmgModifierByArmor(int i) {
    this._dmgModifierByArmor += i;
  }
  
  public int getBowHitModifierByArmor() {
    return this._bowHitModifierByArmor;
  }
  
  public void addBowHitModifierByArmor(int i) {
    this._bowHitModifierByArmor += i;
  }
  
  public int getBowDmgModifierByArmor() {
    return this._bowDmgModifierByArmor;
  }
  
  public void addBowDmgModifierByArmor(int i) {
    this._bowDmgModifierByArmor += i;
  }
  
  public boolean isGresValid() {
    return this._gresValid;
  }
  
  private void setGresValid(boolean valid) {
    this._gresValid = valid;
  }
  
  public boolean isFishing() {
    return this._isFishing;
  }
  
  public int get_fishX() {
    return this._fishX;
  }
  
  public int get_fishY() {
    return this._fishY;
  }
  
  public void setFishing(boolean flag, int fishX, int fishY) {
    this._isFishing = flag;
    this._fishX = fishX;
    this._fishY = fishY;
  }
  
  public int getFishingPoleId() {
    return this._fishingpoleid;
  }
  
  public void setFishingPoleId(int itemid) {
    this._fishingpoleid = itemid;
  }
  
  public int getCookingId() {
    return this._cookingId;
  }
  
  public void setCookingId(int i) {
    this._cookingId = i;
  }
  
  public int getDessertId() {
    return this._dessertId;
  }
  
  public void setDessertId(int i) {
    this._dessertId = i;
  }
  
  public void resetBaseDmgup() {
    int newBaseDmgup = 0;
    int newBaseBowDmgup = 0;
    if (isKnight() || isDarkelf() || isDragonKnight()) {
      newBaseDmgup = getLevel() / 10;
      newBaseBowDmgup = 0;
    } else if (isElf()) {
      newBaseDmgup = 0;
      newBaseBowDmgup = getLevel() / 10;
    } 
    addDmgup(newBaseDmgup - this._baseDmgup);
    addBowDmgup(newBaseBowDmgup - this._baseBowDmgup);
    this._baseDmgup = newBaseDmgup;
    this._baseBowDmgup = newBaseBowDmgup;
  }
  
  public void resetBaseHitup() {
    int newBaseHitup = 0;
    int newBaseBowHitup = 0;
    if (isCrown()) {
      newBaseHitup = getLevel() / 5;
      newBaseBowHitup = getLevel() / 5;
    } else if (isKnight()) {
      newBaseHitup = getLevel() / 3;
      newBaseBowHitup = getLevel() / 3;
    } else if (isElf()) {
      newBaseHitup = getLevel() / 5;
      newBaseBowHitup = getLevel() / 5;
    } else if (isDarkelf()) {
      newBaseHitup = getLevel() / 3;
      newBaseBowHitup = getLevel() / 3;
    } else if (isDragonKnight()) {
      newBaseHitup = getLevel() / 4;
      newBaseBowHitup = getLevel() / 4;
    } else if (isIllusionist()) {
      newBaseHitup = getLevel() / 5;
      newBaseBowHitup = getLevel() / 5;
    } 
    addHitup(newBaseHitup - this._baseHitup);
    addBowHitup(newBaseBowHitup - this._baseBowHitup);
    this._baseHitup = newBaseHitup;
    this._baseBowHitup = newBaseBowHitup;
  }
  
  public void resetBaseAc() {
    int newAc = CalcStat.calcAc(getLevel(), getBaseDex());
    addAc(newAc - this._baseAc);
    this._baseAc = newAc;
  }
  
  public void resetBaseMr() {
    int newMr = 0;
    if (isCrown()) {
      newMr = 10;
    } else if (isElf()) {
      newMr = 25;
    } else if (isWizard()) {
      newMr = 15;
    } else if (isDarkelf()) {
      newMr = 10;
    } else if (isDragonKnight()) {
      newMr = 18;
    } else if (isIllusionist()) {
      newMr = 20;
    } 
    newMr += CalcStat.calcStatMr(getWis());
    newMr += getLevel() / 2;
    addMr(newMr - this._baseMr);
    this._baseMr = newMr;
  }
  
  public void resetLevel() {
    setLevel(ExpTable.getLevelByExp(this._exp));
  }
  
  public void resetOriginalHpup() {
    this._originalHpup = L1PcOriginal.resetOriginalHpup(this);
  }
  
  public void resetOriginalMpup() {
    this._originalMpup = L1PcOriginal.resetOriginalMpup(this);
  }
  
  public void resetOriginalStrWeightReduction() {
    this._originalStrWeightReduction = L1PcOriginal.resetOriginalStrWeightReduction(this);
  }
  
  public void resetOriginalDmgup() {
    this._originalDmgup = L1PcOriginal.resetOriginalDmgup(this);
  }
  
  public void resetOriginalConWeightReduction() {
    this._originalConWeightReduction = L1PcOriginal.resetOriginalConWeightReduction(this);
  }
  
  public void resetOriginalBowDmgup() {
    this._originalBowDmgup = L1PcOriginal.resetOriginalBowDmgup(this);
  }
  
  public void resetOriginalHitup() {
    this._originalHitup = L1PcOriginal.resetOriginalHitup(this);
  }
  
  public void resetOriginalBowHitup() {
    this._originalBowHitup = L1PcOriginal.resetOriginalBowHitup(this);
  }
  
  public void resetOriginalMr() {
    addMr(this._originalMr = L1PcOriginal.resetOriginalMr(this));
  }
  
  public void resetOriginalMagicHit() {
    this._originalMagicHit = L1PcOriginal.resetOriginalMagicHit(this);
  }
  
  public void resetOriginalMagicCritical() {
    this._originalMagicCritical = L1PcOriginal.resetOriginalMagicCritical(this);
  }
  
  public void resetOriginalMagicConsumeReduction() {
    this._originalMagicConsumeReduction = L1PcOriginal.resetOriginalMagicConsumeReduction(this);
  }
  
  public void resetOriginalMagicDamage() {
    this._originalMagicDamage = L1PcOriginal.resetOriginalMagicDamage(this);
  }
  
  public void resetOriginalAc() {
    this._originalAc = L1PcOriginal.resetOriginalAc(this);
    addAc(0 - this._originalAc);
  }
  
  public void resetOriginalEr() {
    this._originalEr = L1PcOriginal.resetOriginalEr(this);
  }
  
  public void resetOriginalHpr() {
    this._originalHpr = L1PcOriginal.resetOriginalHpr(this);
  }
  
  public void resetOriginalMpr() {
    this._originalMpr = L1PcOriginal.resetOriginalMpr(this);
  }
  
  public void refresh() {
    resetLevel();
    resetBaseHitup();
    resetBaseDmgup();
    resetBaseMr();
    resetBaseAc();
    resetOriginalHpup();
    resetOriginalMpup();
    resetOriginalDmgup();
    resetOriginalBowDmgup();
    resetOriginalHitup();
    resetOriginalBowHitup();
    resetOriginalMr();
    resetOriginalMagicHit();
    resetOriginalMagicCritical();
    resetOriginalMagicConsumeReduction();
    resetOriginalMagicDamage();
    resetOriginalAc();
    resetOriginalEr();
    resetOriginalHpr();
    resetOriginalMpr();
    resetOriginalStrWeightReduction();
    resetOriginalConWeightReduction();
  }
  
  public L1ExcludingList getExcludingList() {
    return this._excludingList;
  }
  
  public int getTeleportX() {
    return this._teleportX;
  }
  
  public void setTeleportX(int i) {
    this._teleportX = i;
  }
  
  public int getTeleportY() {
    return this._teleportY;
  }
  
  public void setTeleportY(int i) {
    this._teleportY = i;
  }
  
  public short getTeleportMapId() {
    return this._teleportMapId;
  }
  
  public void setTeleportMapId(short i) {
    this._teleportMapId = i;
  }
  
  public int getTeleportHeading() {
    return this._teleportHeading;
  }
  
  public void setTeleportHeading(int i) {
    this._teleportHeading = i;
  }
  
  public int getTempCharGfxAtDead() {
    return this._tempCharGfxAtDead;
  }
  
  private void setTempCharGfxAtDead(int i) {
    this._tempCharGfxAtDead = i;
  }
  
  public boolean isCanWhisper() {
    return this._isCanWhisper;
  }
  
  public void setCanWhisper(boolean flag) {
    this._isCanWhisper = flag;
  }
  
  public boolean isShowTradeChat() {
    return this._isShowTradeChat;
  }
  
  public void setShowTradeChat(boolean flag) {
    this._isShowTradeChat = flag;
  }
  
  public boolean isShowWorldChat() {
    return this._isShowWorldChat;
  }
  
  public void setShowWorldChat(boolean flag) {
    this._isShowWorldChat = flag;
  }
  
  public int getFightId() {
    return this._fightId;
  }
  
  public void setFightId(int i) {
    this._fightId = i;
  }
  
  public void checkChatInterval() {
    long nowChatTimeInMillis = System.currentTimeMillis();
    if (this._chatCount == 0) {
      this._chatCount = (byte)(this._chatCount + 1);
      this._oldChatTimeInMillis = nowChatTimeInMillis;
      return;
    } 
    long chatInterval = nowChatTimeInMillis - this._oldChatTimeInMillis;
    if (chatInterval > 2000L) {
      this._chatCount = 0;
      this._oldChatTimeInMillis = 0L;
    } else {
      if (this._chatCount >= 5) {
        setSkillEffect(4002, 120000);
        sendPackets((ServerBasePacket)new S_PacketBox(36, 120));
        sendPackets((ServerBasePacket)new S_ServerMessage(153));
        this._chatCount = 0;
        this._oldChatTimeInMillis = 0L;
      } 
      this._chatCount = (byte)(this._chatCount + 1);
    } 
  }
  
  public int getCallClanId() {
    return this._callClanId;
  }
  
  public void setCallClanId(int i) {
    this._callClanId = i;
  }
  
  public int getCallClanHeading() {
    return this._callClanHeading;
  }
  
  public void setCallClanHeading(int i) {
    this._callClanHeading = i;
  }
  
  public boolean isInCharReset() {
    return this._isInCharReset;
  }
  
  public void setInCharReset(boolean flag) {
    this._isInCharReset = flag;
  }
  
  public int getTempLevel() {
    return this._tempLevel;
  }
  
  public void setTempLevel(int i) {
    this._tempLevel = i;
  }
  
  public int getTempMaxLevel() {
    return this._tempMaxLevel;
  }
  
  public void setTempMaxLevel(int i) {
    this._tempMaxLevel = i;
  }
  
  public boolean isSummonMonster() {
    return this._isSummonMonster;
  }
  
  public void setSummonMonster(boolean SummonMonster) {
    this._isSummonMonster = SummonMonster;
  }
  
  public boolean isShapeChange() {
    return this._isShapeChange;
  }
  
  public void setShapeChange(boolean isShapeChange) {
    this._isShapeChange = isShapeChange;
  }
  
  public String getText() {
    return this._text;
  }
  
  public void setText(String text) {
    this._text = text;
  }
  
  public byte[] getTextByte() {
    return this._textByte;
  }
  
  public void setTextByte(byte[] textByte) {
    this._textByte = textByte;
  }
  
  public L1PcOther get_other() {
    return this._other;
  }
  
  public void set_other(L1PcOther other) {
    this._other = other;
  }
  
  public L1PcOther1 get_other1() {
    return this._other1;
  }
  
  public void set_other1(L1PcOther1 other1) {
    this._other1 = other1;
  }
  
  public L1PcOther2 get_other2() {
    return this._other2;
  }
  
  public void set_other2(L1PcOther2 l1PcOther2) {
    this._other2 = l1PcOther2;
  }
  
  public L1PcOther3 get_other3() {
    return this._other3;
  }
  
  public void set_other3(L1PcOther3 other3) {
    this._other3 = other3;
  }
  
  public L1PcOtherList get_otherList() {
    return this._otherList;
  }
  
  public void set_otherList(L1PcOtherList other) {
    this._otherList = other;
  }
  
  public int getOleLocX() {
    return this._oleLocX;
  }
  
  public void setOleLocX(int oleLocx) {
    this._oleLocX = oleLocx;
  }
  
  public int getOleLocY() {
    return this._oleLocY;
  }
  
  public void setOleLocY(int oleLocy) {
    this._oleLocY = oleLocy;
  }
  
  public L1Character getNowTarget() {
    return this._target;
  }
  
  public void setNowTarget(L1Character target) {
    this._target = target;
  }
  
  public void setPetModel() {
    try {
      Iterator<L1NpcInstance> iterator = getPetList().values().iterator();
      while (iterator.hasNext()) {
        L1NpcInstance petNpc = iterator.next();
        if (petNpc != null) {
          if (petNpc instanceof L1SummonInstance) {
            L1SummonInstance summon = (L1SummonInstance)petNpc;
            summon.set_tempModel();
            continue;
          } 
          if (!(petNpc instanceof L1PetInstance))
            continue; 
          L1PetInstance pet = (L1PetInstance)petNpc;
          pet.set_tempModel();
        } 
      } 
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
    } 
  }
  
  public void getPetModel() {
    try {
      Iterator<L1NpcInstance> iterator = getPetList().values().iterator();
      while (iterator.hasNext()) {
        L1NpcInstance petNpc = iterator.next();
        if (petNpc != null) {
          if (petNpc instanceof L1SummonInstance) {
            L1SummonInstance summon = (L1SummonInstance)petNpc;
            summon.get_tempModel();
            continue;
          } 
          if (!(petNpc instanceof L1PetInstance))
            continue; 
          L1PetInstance pet = (L1PetInstance)petNpc;
          pet.get_tempModel();
        } 
      } 
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
    } 
  }
  
  public L1DeInstance get_outChat() {
    return this._outChat;
  }
  
  public void set_outChat(L1DeInstance b) {
    this._outChat = b;
  }
  
  public long get_h_time() {
    return this._h_time;
  }
  
  public void set_h_time(long time) {
    this._h_time = time;
  }
  
  public boolean is_mazu() {
    return this._mazu;
  }
  
  public void set_mazu(boolean b) {
    this._mazu = b;
  }
  
  public long get_mazu_time() {
    return this._mazu_time;
  }
  
  public void set_mazu_time(long time) {
    this._mazu_time = time;
  }
  
  public void set_dmgAdd(int int1, int int2) {
    this._int1 += int1;
    this._int2 += int2;
  }
  
  public int dmgAdd() {
    if (this._int2 == 0)
      return 0; 
    if (_random.nextInt(100) + 1 <= this._int2) {
      if (!getDolls().isEmpty()) {
        Iterator<L1DollInstance> iterator = getDolls().values().iterator();
        while (iterator.hasNext()) {
          L1DollInstance doll = iterator.next();
          doll.show_action(1);
        } 
      } 
      return this._int1;
    } 
    return 0;
  }
  
  public int get_evasion() {
    return this._evasion;
  }
  
  public void set_evasion(int int1) {
    this._evasion += int1;
  }
  
  public double getExpAdd() {
    return this._expadd;
  }
  
  public void add_exp(int s) {
    if (s > 0) {
      this._expadd = DoubleUtil.sum(this._expadd, s / 100.0D);
    } else {
      this._expadd = DoubleUtil.sub(this._expadd, (s * -1) / 100.0D);
    } 
  }
  
  public void set_dmgDowe(int int1, int int2) {
    this._dd1 += int1;
    this._dd2 += int2;
  }
  
  public int dmgDowe() {
    if (has_powerid(6611)) {
      int rad = 10;
      if (_random.nextInt(100) < 10) {
        sendPacketsAll((ServerBasePacket)new S_SkillSound(getId(), 9800));
        return this._dd1;
      } 
    } 
    if (this._dd2 == 0)
      return 0; 
    if (_random.nextInt(100) + 1 <= this._dd2) {
      if (!getDolls().isEmpty()) {
        Iterator<L1DollInstance> iterator = getDolls().values().iterator();
        while (iterator.hasNext()) {
          L1DollInstance doll = iterator.next();
          doll.show_action(2);
        } 
      } 
      return this._dd1;
    } 
    return 0;
  }
  
  public boolean isFoeSlayer() {
    return this._isFoeSlayer;
  }
  
  public void setFoeSlayer(boolean FoeSlayer) {
    this._isFoeSlayer = FoeSlayer;
  }
  
  public long get_weaknss_t() {
    return this._weaknss_t;
  }
  
  public int get_weaknss() {
    return this._weaknss;
  }
  
  public void set_weaknss(int lv, long t) {
    this._weaknss = lv;
    this._weaknss_t = t;
  }
  
  public int get_actionId() {
    return this._actionId;
  }
  
  public void set_actionId(int actionId) {
    this._actionId = actionId;
  }
  
  public Chapter01R get_hardinR() {
    return this._hardin;
  }
  
  public void set_hardinR(Chapter01R hardin) {
    this._hardin = hardin;
  }
  
  public void add_power(L1ItemPower_text value, L1ItemInstance eq) {
    if (!this._allpowers.containsKey(Integer.valueOf(value.get_id())))
      this._allpowers.put(Integer.valueOf(value.get_id()), value); 
    if (eq.isEquipped()) {
      value.add_pc_power(this);
      sendPackets((ServerBasePacket)new S_ServerMessage("\\fW获得" + value.getMsg() + " 效果"));
    } 
    if (value.getGfx() != null) {
      int gfx2[], length = (gfx2 = value.getGfx()).length;
      int i = 0;
      while (i < length) {
        int gfx = gfx2[i];
        sendPacketsAll((ServerBasePacket)new S_SkillSound(getId(), gfx));
        i++;
      } 
    } 
  }
  
  public void remove_power(L1ItemPower_text value, L1ItemInstance eq) {
    if (this._allpowers.containsKey(Integer.valueOf(value.get_id())))
      this._allpowers.remove(Integer.valueOf(value.get_id())); 
    if (!eq.isEquipped()) {
      value.remove_pc_power(this);
      sendPackets((ServerBasePacket)new S_ServerMessage("\\fY失去 " + value.getMsg() + " 效果"));
    } 
  }
  
  public boolean has_powerid(int powerid) {
    return this._allpowers.containsKey(Integer.valueOf(powerid));
  }
  
  public Map<Integer, L1ItemPower_text> get_allpowers() {
    return this._allpowers;
  }
  
  public int get_unfreezingTime() {
    return this._unfreezingTime;
  }
  
  public void set_unfreezingTime(int i) {
    this._unfreezingTime = i;
  }
  
  public int get_misslocTime() {
    return this._misslocTime;
  }
  
  public void set_misslocTime(int i) {
    this._misslocTime = i;
  }
  
  public L1User_Power get_c_power() {
    return this._c_power;
  }
  
  public void set_c_power(L1User_Power power) {
    this._c_power = power;
  }
  
  public void add_dice_hp(int dice_hp, int sucking_hp) {
    this._dice_hp += dice_hp;
    this._sucking_hp += sucking_hp;
  }
  
  public int dice_hp() {
    return this._dice_hp;
  }
  
  public int sucking_hp() {
    return this._sucking_hp;
  }
  
  public void add_dice_mp(int dice_mp, int sucking_mp) {
    this._dice_mp += dice_mp;
    this._sucking_mp += sucking_mp;
  }
  
  public int dice_mp() {
    return this._dice_mp;
  }
  
  public int sucking_mp() {
    return this._sucking_mp;
  }
  
  public void add_double_dmg(int double_dmg) {
    this._double_dmg += double_dmg;
  }
  
  public int get_double_dmg() {
    return this._double_dmg;
  }
  
  public void add_lift(int lift) {
    this._lift += lift;
  }
  
  public int lift() {
    return this._lift;
  }
  
  public void add_magic_modifier_dmg(int add) {
    this._magic_modifier_dmg += add;
  }
  
  public int get_magic_modifier_dmg() {
    return this._magic_modifier_dmg;
  }
  
  public void add_magic_reduction_dmg(int add) {
    this._magic_reduction_dmg += add;
  }
  
  public int get_magic_reduction_dmg() {
    return this._magic_reduction_dmg;
  }
  
  public void rename(boolean b) {
    this._rname = b;
  }
  
  public boolean is_rname() {
    return this._rname;
  }
  
  public boolean is_retitle() {
    return this._retitle;
  }
  
  public void retitle(boolean b) {
    this._retitle = b;
  }
  
  public int is_repass() {
    return this._repass;
  }
  
  public void repass(int b) {
    this._repass = b;
  }
  
  public void add_trade_item(L1TradeItem info) {
    if (this._trade_items.size() == 16)
      return; 
    this._trade_items.add(info);
  }
  
  public ArrayList<L1TradeItem> get_trade_items() {
    return this._trade_items;
  }
  
  public void get_trade_clear() {
    this._tradeID = 0;
    this._trade_items.clear();
  }
  
  public int get_mode_id() {
    return this._mode_id;
  }
  
  public void set_mode_id(int mode) {
    this._mode_id = mode;
  }
  
  public boolean get_check_item() {
    return this._check_item;
  }
  
  public void set_check_item(boolean b) {
    this._check_item = b;
  }
  
  public void set_VIP1(boolean b) {
    this._vip_1 = b;
  }
  
  public void set_VIP2(boolean b) {
    this._vip_2 = b;
  }
  
  public void set_VIP3(boolean b) {
    this._vip_3 = b;
  }
  
  public void set_VIP4(boolean b) {
    this._vip_4 = b;
  }
  
  public long get_global_time() {
    return this._global_time;
  }
  
  public void set_global_time(long global_time) {
    this._global_time = global_time;
  }
  
  public int get_doll_hpr() {
    return this._doll_hpr;
  }
  
  public void set_doll_hpr(int hpr) {
    this._doll_hpr = hpr;
  }
  
  public int get_doll_hpr_time() {
    return this._doll_hpr_time;
  }
  
  public void set_doll_hpr_time(int time) {
    this._doll_hpr_time = time;
  }
  
  public int get_doll_hpr_time_src() {
    return this._doll_hpr_time_src;
  }
  
  public void set_doll_hpr_time_src(int time) {
    this._doll_hpr_time_src = time;
  }
  
  public int get_doll_mpr() {
    return this._doll_mpr;
  }
  
  public void set_doll_mpr(int mpr) {
    this._doll_mpr = mpr;
  }
  
  public int get_doll_mpr_time() {
    return this._doll_mpr_time;
  }
  
  public void set_doll_mpr_time(int time) {
    this._doll_mpr_time = time;
  }
  
  public int get_doll_mpr_time_src() {
    return this._doll_mpr_time_src;
  }
  
  public void set_doll_mpr_time_src(int time) {
    this._doll_mpr_time_src = time;
  }
  
  public int[] get_doll_get() {
    return this._doll_get;
  }
  
  public void set_doll_get(int itemid, int count) {
    this._doll_get[0] = itemid;
    this._doll_get[1] = count;
  }
  
  public int get_doll_get_time() {
    return this._doll_get_time;
  }
  
  public void set_doll_get_time(int time) {
    this._doll_get_time = time;
  }
  
  public int get_doll_get_time_src() {
    return this._doll_get_time_src;
  }
  
  public void set_doll_get_time_src(int time) {
    this._doll_get_time_src = time;
  }
  
  public String get_board_title() {
    return this._board_title;
  }
  
  public void set_board_title(String text) {
    this._board_title = text;
  }
  
  public String get_board_content() {
    return this._board_content;
  }
  
  public void set_board_content(String text) {
    this._board_content = text;
  }
  
  public long get_spr_move_time() {
    return this._spr_move_time;
  }
  
  public void set_spr_move_time(long spr_time) {
    this._spr_move_time = spr_time;
  }
  
  public long get_spr_attack_time() {
    return this._spr_attack_time;
  }
  
  public void set_spr_attack_time(long spr_time) {
    this._spr_attack_time = spr_time;
  }
  
  public long get_spr_skill_time() {
    return this._spr_skill_time;
  }
  
  public void set_spr_skill_time(long spr_time) {
    this._spr_skill_time = spr_time;
  }
  
  public int get_delete_time() {
    return this._delete_time;
  }
  
  public void set_delete_time(int time) {
    this._delete_time = time;
  }
  
  public void add_up_hp_potion(int up_hp_potion) {
    this._up_hp_potion += up_hp_potion;
  }
  
  public int get_up_hp_potion() {
    return this._up_hp_potion;
  }
  
  public void add_uhp_number(int uhp_number) {
    this._uhp_number += uhp_number;
  }
  
  public int get_uhp_number() {
    return this._uhp_number;
  }
  
  public int get_venom_resist() {
    return this._venom_resist;
  }
  
  public void set_venom_resist(int i) {
    this._venom_resist += i;
  }
  
  public void addInviteList(String playername) {
    if (this._InviteList.contains(playername))
      return; 
    this._InviteList.add(playername);
  }
  
  public void removeInviteList(String name) {
    if (!this._InviteList.contains(name))
      return; 
    this._InviteList.remove(name);
  }
  
  public ArrayList<String> getInviteList() {
    return this._InviteList;
  }
  
  public void addCMAList(String clanname) {
    if (this._cmalist.contains(clanname))
      return; 
    this._cmalist.add(clanname);
  }
  
  public void removeCMAList(String name) {
    if (!this._cmalist.contains(name))
      return; 
    this._cmalist.remove(name);
  }
  
  public ArrayList<String> getCMAList() {
    return this._cmalist;
  }
  
  public final int getEmblemId() {
    if (isProtector() || getClanid() <= 0)
      return 0; 
    L1Clan clan = getClan();
    if (clan == null)
      return 0; 
    return clan.getEmblemId();
  }
  
  public AcceleratorChecker speed_Attack() {
    if (this._speed == null)
      this._speed = new AcceleratorChecker(this); 
    return this._speed;
  }
  
  public int get_arena() {
    return this._arena;
  }
  
  public void set_arena(int i) {
    this._arena = i;
  }
  
  public int get_temp_adena() {
    return this._temp_adena;
  }
  
  public void set_temp_adena(int itemid) {
    this._temp_adena = itemid;
  }
  
  public long get_ss_time() {
    return this._ss_time;
  }
  
  public void set_ss_time(long ss_time) {
    this._ss_time = ss_time;
  }
  
  public void set_ss_time(int ss) {
    this._ss = ss;
  }
  
  public int get_ss() {
    return this._ss;
  }
  
  public final int getKillCount() {
    return this.killCount;
  }
  
  public final void setKillCount(int killCount) {
    this.killCount = killCount;
  }
  
  public int getMeteLevel() {
    return this._meteLevel;
  }
  
  public void setMeteLevel(int i) {
    this._meteLevel = i;
  }
  
  public final L1MeteAbility getMeteAbility() {
    return this._meteAbility;
  }
  
  public final void resetMeteAbility() {
    if (this._meteAbility != null)
      ExtraMeteAbilityTable.effectBuff(this, this._meteAbility, -1); 
    this._meteAbility = ExtraMeteAbilityTable.getInstance().get(getMeteLevel(), getType());
    if (this._meteAbility != null)
      ExtraMeteAbilityTable.effectBuff(this, this._meteAbility, 1); 
  }
  
  public final boolean isEffectDADIS() {
    return this._EffectDADIS;
  }
  
  public final void setDADIS(boolean checkFlag) {
    if (this._EffectDADIS != checkFlag) {
      giveDADIS(checkFlag);
      sendPackets((ServerBasePacket)new S_HPUpdate(this));
      if (isInParty())
        getParty().updateMiniHP(this); 
      sendPackets((ServerBasePacket)new S_MPUpdate(this));
      sendPackets((ServerBasePacket)new S_SPMR(this));
      L1PcUnlock.Pc_Unlock(this);
    } 
  }
  
  public final void giveDADIS(boolean checkFlag) {
    this._EffectDADIS = checkFlag;
    if (checkFlag) {
      addMaxHp(50);
      addMaxMp(30);
      addDmgup(3);
      addBowDmgup(3);
      addSp(3);
      addDamageReductionByArmor(3);
      addHpr(3);
      addMpr(3);
    } else {
      addMaxHp(-50);
      addMaxMp(-30);
      addDmgup(-3);
      addBowDmgup(-3);
      addSp(-3);
      addDamageReductionByArmor(-3);
      addHpr(-3);
      addMpr(-3);
      sendPackets((ServerBasePacket)new S_PacketBox(180, 553, 3907, 0));
    } 
  }
  
  public final boolean isEffectGS() {
    return this._EffectGS;
  }
  
  public final void setGS(boolean checkFlag) {
    if (this._EffectGS != checkFlag) {
      giveGS(checkFlag);
      sendPackets((ServerBasePacket)new S_HPUpdate(this));
      if (isInParty())
        getParty().updateMiniHP(this); 
      sendPackets((ServerBasePacket)new S_MPUpdate(this));
      sendPackets((ServerBasePacket)new S_SPMR(this));
      L1PcUnlock.Pc_Unlock(this);
    } 
  }
  
  public final void giveGS(boolean checkFlag) {
    this._EffectGS = checkFlag;
    if (checkFlag) {
      addMaxHp(30);
      addMaxMp(30);
      addDmgup(2);
      addBowDmgup(2);
      addSp(2);
      addDamageReductionByArmor(2);
      addHpr(2);
      addMpr(2);
    } else {
      addMaxHp(-30);
      addMaxMp(-30);
      addDmgup(-2);
      addBowDmgup(-2);
      addSp(-2);
      addDamageReductionByArmor(-2);
      addHpr(-2);
      addMpr(-2);
    } 
  }
  
  public final boolean isProtector() {
    return this._isProtector;
  }
  
  public final void setProtector(boolean checkFlag) {
    if (this._isProtector != checkFlag) {
      giveProtector(checkFlag);
      sendPackets((ServerBasePacket)new S_HPUpdate(this));
      if (isInParty())
        getParty().updateMiniHP(this); 
      sendPackets((ServerBasePacket)new S_MPUpdate(this));
      sendPackets((ServerBasePacket)new S_SPMR(this));
      sendPackets((ServerBasePacket)new S_OwnCharStatus(this));
      sendPackets((ServerBasePacket)new S_OwnCharPack(this));
      removeAllKnownObjects();
      updateObject();
    } 
  }
  
  public final void giveProtector(boolean checkFlag) {
    this._isProtector = checkFlag;
    if (checkFlag) {
      addMaxHp(ProtectorSet.HP_UP);
      addMaxMp(ProtectorSet.MP_UP);
      addDmgup(ProtectorSet.DMG_UP);
      addBowDmgup(ProtectorSet.DMG_UP);
      addDamageReductionByArmor(ProtectorSet.DMG_DOWN);
      addSp(ProtectorSet.SP_UP);
      sendPackets((ServerBasePacket)new S_PacketBox(144, 1));
    } else {
      addMaxHp(-ProtectorSet.HP_UP);
      addMaxMp(-ProtectorSet.MP_UP);
      addDmgup(-ProtectorSet.DMG_UP);
      addBowDmgup(-ProtectorSet.DMG_UP);
      addDamageReductionByArmor(-ProtectorSet.DMG_DOWN);
      addSp(-ProtectorSet.SP_UP);
      sendPackets((ServerBasePacket)new S_PacketBox(144, 0));
    } 
  }
  
  public final L1Apprentice getApprentice() {
    return this._apprentice;
  }
  
  public final void setApprentice(L1Apprentice apprentice) {
    this._apprentice = apprentice;
  }
  
  public final void checkEffect() {
    int checkType = 0;
    if (getApprentice() != null) {
      L1PcInstance master = World.get().getPlayer(getApprentice().getMaster().getName());
      if (master != null) {
        L1Party party = getParty();
        if (party != null) {
          checkType = party.checkMentor(getApprentice());
        } else {
          checkType = 1;
        } 
      } 
    } 
    if (this._tempType != checkType) {
      if (checkType > 0)
        sendEffectBuff(this._tempType, -1); 
      if (checkType > 0)
        sendEffectBuff(checkType, 1); 
      sendPackets((ServerBasePacket)new S_SPMR(this));
      sendPackets((ServerBasePacket)new S_OwnCharStatus(this));
      sendPackets((ServerBasePacket)new S_PacketBox(132, getEr()));
      if (checkType <= 0) {
        sendPackets((ServerBasePacket)new S_PacketBox(147, 0, Math.max(this._tempType - 1, 0)));
      } else {
        sendPackets((ServerBasePacket)new S_PacketBox(147, (checkType != 0) ? 1 : 0, Math.max(checkType - 1, 0)));
      } 
      this._tempType = checkType;
    } 
  }
  
  public void addOriginalEr(int i) {
    this._originalEr += i;
  }
  
  private void sendEffectBuff(int buffType, int negative) {
    switch (buffType) {
      case 1:
        addAc(-1 * negative);
        break;
      case 2:
        addAc(-1 * negative);
        addMr(1 * negative);
        break;
      case 3:
        addAc(-1 * negative);
        addMr(1 * negative);
        addWater(2 * negative);
        addWind(2 * negative);
        addFire(2 * negative);
        addEarth(2 * negative);
        break;
      case 4:
        addAc(-1 * negative);
        addMr(1 * negative);
        addWater(2 * negative);
        addWind(2 * negative);
        addFire(2 * negative);
        addEarth(2 * negative);
        addOriginalEr(1 * negative);
        break;
      case 5:
        addAc(-3 * negative);
        break;
      case 6:
        addAc(-3 * negative);
        addMr(3 * negative);
        break;
      case 7:
        addAc(-3 * negative);
        addMr(3 * negative);
        addWater(6 * negative);
        addWind(6 * negative);
        addFire(6 * negative);
        addEarth(6 * negative);
        break;
      case 8:
        addAc(-3 * negative);
        addMr(3 * negative);
        addWater(6 * negative);
        addWind(6 * negative);
        addFire(6 * negative);
        addEarth(6 * negative);
        addOriginalEr(3 * negative);
        break;
    } 
  }
  
  public final Timestamp getPunishTime() {
    return this._punishTime;
  }
  
  public final void setPunishTime(Timestamp timestamp) {
    this._punishTime = timestamp;
  }
  
//  public final String getViewName() {
//    StringBuffer sbr = new StringBuffer();
//    if (isProtector()) {
//      sbr.append("**守护者**");
//    } else if (hasSkillEffect(51234)) {
//      sbr.append("商人");
//    } 
//    else {
//      sbr.append(getName());
////      sbr.append(_prestigeName);
////      sbr.append(_rebornLVName); 
////      if (getvipname() != null)
////        sbr.append(getvipname()); 
//    } 
//    return sbr.toString();
//  }
//  
  
  
  public final String getViewName() {
	    StringBuffer sbr = new StringBuffer();
	    if (isProtector()) {
	      sbr.append("**守護者**");
	    } else if (hasSkillEffect(51234)) {
	      sbr.append("尿尿商人");
	    } else {
	      sbr.append(getName());
//	      String getPrestigeLv = "";
//	      if (prestigtable.START && getPrestige() > 0) {
//	        getPrestigeLv = RewardPrestigeTable.get().getTitle(getPrestigeLv());
//	        sbr.append(getPrestigeLv);
//	      } 
//	      if (this._meteAbility != null)
//	        sbr.append(this._meteAbility.getTitle()); 
//	      if (getvipname() != null)
//	        sbr.append(getvipname()); 
	    } 
	    return sbr.toString();
	  }
  
	public String get_prestigeName() {
		return _prestigeName;
	}

	public void set_prestigeName() {
	      if (prestigtable.START && getPrestige() > 0) {
	    	  _prestigeName = RewardPrestigeTable.get().getTitle(getPrestigeLv());
	        } 
	}
	
	

	public String get_rebornLVName() {
		return _rebornLVName;
	}

	public void set_rebornLVName() {
		if (this._meteAbility != null)
			this._rebornLVName = this._meteAbility.getTitle();
	}
  
	

  
  public int getMagicDmgModifier() {
    return this._magicDmgModifier;
  }
  
  public void addMagicDmgModifier(int i) {
    this._magicDmgModifier += i;
  }
  
  public int getMagicDmgReduction() {
    return this._magicDmgReduction;
  }
  
  public void addMagicDmgReduction(int i) {
    this._magicDmgReduction += i;
  }
  
  public void set_elitePlateMail_Fafurion(int r, int hpmin, int hpmax) {
    this._elitePlateMail_Fafurion = r;
    this._fafurion_hpmin = hpmin;
    this._fafurion_hpmax = hpmax;
  }
  
  public void set_elitePlateMail_Lindvior(int r, int mpmin, int mpmax) {
    this._elitePlateMail_Lindvior = r;
    this._lindvior_mpmin = mpmin;
    this._lindvior_mpmax = mpmax;
  }
  
  public void set_elitePlateMail_Valakas(int dmg, int bowdmg) {
    this._valakas_dmg = dmg;
    this._valakas_bowdmg = bowdmg;
  }
  
  public int get_elitePlateMail_Valakasdmg() {
    return this._valakas_dmg;
  }
  
  public int get_elitePlateMail_Valakasbowdmg() {
    return this._valakas_bowdmg;
  }
  
  public void set_hades_cloak(int r, int dmgmin, int dmgmax) {
    this._hades_cloak = r;
    this._hades_cloak_dmgmin = dmgmin;
    this._hades_cloak_dmgmax = dmgmax;
  }
  
  public void set_Hexagram_Magic_Rune(int r, int hpmin, int hpmax, int gfx) {
    this._Hexagram_Magic_Rune = r;
    this._hexagram_hpmin = hpmin;
    this._hexagram_hpmax = hpmax;
    this._hexagram_gfx = gfx;
  }
  
  public void set_DimiterBless(int r, int mpmin, int mpmax, int r2, int time) {
    this._dimiter_mpr_rnd = r;
    this._dimiter_mpmin = mpmin;
    this._dimiter_mpmax = mpmax;
    this._dimiter_bless = r2;
    this._dimiter_time = time;
  }
  
  public int getExpPoint() {
    return this._expPoint;
  }
  
  public void setExpPoint(int i) {
    this._expPoint = i;
  }
  
  public int getSummonId() {
    return this._SummonId;
  }
  
  public void setSummonId(int SummonId) {
    this._SummonId = SummonId;
  }
  
  public int getLap() {
    return this._lap;
  }
  
  public void setLap(int i) {
    this._lap = i;
  }
  
  public int getLapCheck() {
    return this._lapCheck;
  }
  
  public void setLapCheck(int i) {
    this._lapCheck = i;
  }
  
  public int getLapScore() {
    return this._lap * 29 + this._lapCheck;
  }
  
  public boolean isInOrderList() {
    return this._order_list;
  }
  
  public void setInOrderList(boolean bool) {
    this._order_list = bool;
  }
  
  public int get_bighot() {
    return this._isBigHot;
  }
  
  public void set_bighot(int i) {
    this._isBigHot = i;
  }
  
  public String getBighot1() {
    return this._bighot1;
  }
  
  public void setBighot1(String bighot1) {
    this._bighot1 = bighot1;
  }
  
  public String getBighot2() {
    return this._bighot2;
  }
  
  public void setBighot2(String bighot2) {
    this._bighot2 = bighot2;
  }
  
  public String getBighot3() {
    return this._bighot3;
  }
  
  public void setBighot3(String bighot3) {
    this._bighot3 = bighot3;
  }
  
  public String getBighot4() {
    return this._bighot4;
  }
  
  public void setBighot4(String bighot4) {
    this._bighot4 = bighot4;
  }
  
  public String getBighot5() {
    return this._bighot5;
  }
  
  public void setBighot5(String bighot5) {
    this._bighot5 = bighot5;
  }
  
  public String getBighot6() {
    return this._bighot6;
  }
  
  public void setBighot6(String bighot6) {
    this._bighot6 = bighot6;
  }
  
  public boolean isWindShackle() {
    return hasSkillEffect(167);
  }
  
  private void delSkill(int count) {
    int i = 0;
    while (i < count) {
      int index = _random.nextInt(this._skillList.size());
      Integer skillid = this._skillList.get(index);
      L1Skills skill = SkillsTable.get().getTemplate(skillid.intValue());
      if (this._skillList.remove(skillid)) {
        sendPackets((ServerBasePacket)new S_DelSkill(this, skillid.intValue()));
        CharSkillReading.get().spellLost(getId(), skillid.intValue());
        World.get().broadcastPacketToAll(
            (ServerBasePacket)new S_SystemMessage(String.valueOf(String.valueOf(getName())) + " 的魔法【" + skill.getName() + "】 喷了。"));
      } 
      i++;
    } 
  }
  
  private void checkItemSteal(L1PcInstance fightPc) {
    if (Taketreasure.getInstance().getList().isEmpty())
      return; 
    Iterator<L1Taketreasure> iterator = Taketreasure.getInstance().getList().iterator();
    while (iterator.hasNext()) {
      L1Taketreasure itemSteal = iterator.next();
      L1ItemInstance steal_item = getInventory().findItemId(itemSteal.getItemId());
      if (steal_item == null)
        continue; 
      if (getLevel() < itemSteal.getLevel())
        continue; 
      if (getMeteLevel() < itemSteal.getMeteLevel())
        continue; 
      if (_random.nextInt(100) + 1 >= itemSteal.getStealChance())
        continue; 
      if (itemSteal.getAntiStealItemId() <= 0 || 
        !getInventory().consumeItem(itemSteal.getAntiStealItemId(), 1L)) {
        long steal_count;
        if (steal_item.isStackable()) {
          steal_count = (_random
            .nextInt(Math.max(itemSteal.getMaxStealCount() - itemSteal.getMinStealCount(), 0) + 1) + 
            itemSteal.getMinStealCount());
          steal_count = (steal_item.getCount() >= steal_count) ? steal_count : steal_item.getCount();
        } else {
          steal_count = 1L;
          getInventory().setEquipped(steal_item, false);
        } 
        sendPackets((ServerBasePacket)new S_ServerMessage(638, steal_item.getNumberedViewName(steal_count)));
        if (itemSteal.isDropOnFloor()) {
          steal_item.set_showId(get_showId());
          getInventory().tradeItem(steal_item, steal_count, 
              (L1Inventory)World.get().getInventory(getX(), getY(), getMapId()));
          if (itemSteal.isBroadcast())
            World.get().broadcastPacketToAll((ServerBasePacket)new S_SystemMessage("玩家[" + getViewName() + "]死亡, 似乎有东西[" + 
                  steal_item.getNumberedViewName(steal_count) + "]掉在地上了")); 
        } else {
          getInventory().tradeItem(steal_item, steal_count, (L1Inventory)fightPc.getInventory());
          fightPc.sendPackets((ServerBasePacket)new S_ServerMessage(403, steal_item.getNumberedViewName(steal_count)));
          if (itemSteal.isBroadcast())
            World.get().broadcastPacketToAll(
                (ServerBasePacket)new S_SystemMessage(String.format(itemSteal.getdropmsg(), new Object[] { getViewName(), 
                      fightPc.getViewName(), steal_item.getNumberedViewName(steal_count) }))); 
        } 
        return;
      } 
      sendPackets((ServerBasePacket)new S_SystemMessage(
            "由于身上有[" + ItemTable.get().getTemplate(itemSteal.getAntiStealItemId()).getNameId() + "] 免于被对方夺取: " + 
            steal_item.getLogName()));
    } 
  }
  
  public boolean isATeam() {
    return this._isATeam;
  }
  
  public void setATeam(boolean bool) {
    this._isATeam = bool;
  }
  
  public boolean isBTeam() {
    return this._isBTeam;
  }
  
  public void setBTeam(boolean bool) {
    this._isBTeam = bool;
  }
  
  public Timestamp getRejoinClanTime() {
    return this._rejoinClanTime;
  }
  
  public void setRejoinClanTime(Timestamp time) {
    this._rejoinClanTime = time;
  }
  
  public Timestamp getCreateTime() {
    return this._CreateTime;
  }
  
  public void setCreateTime(Timestamp time) {
    this._CreateTime = time;
  }
  
  public int getSimpleCreateTime() {
    if (this._CreateTime != null) {
      SimpleDateFormat SimpleDate = new SimpleDateFormat("yyyyMMdd");
      int BornTime = Integer.parseInt(SimpleDate.format(Long.valueOf(this._CreateTime.getTime())));
      return BornTime;
    } 
    return 0;
  }
  
  public void setCreateTime() {
    this._CreateTime = new Timestamp(System.currentTimeMillis());
  }
  
  public int getPartyType() {
    return this._partyType;
  }
  
  public void setPartyType(int type) {
    this._partyType = type;
  }
  
  public int getUbScore() {
    return this._ubscore;
  }
  
  public void setUbScore(int i) {
    this._ubscore = i;
  }
  
  public int getInputError() {
    return this._inputerror;
  }
  
  public void setInputError(int i) {
    this._inputerror = i;
  }
  
  public int getSpeedError() {
    return this._speederror;
  }
  
  public void setSpeedError(int i) {
    this._speederror = i;
  }
  
  public int getBanError() {
    return this._banerror;
  }
  
  public void setBanError(int i) {
    this._banerror = i;
  }
  
  public int getInputBanError() {
    return this._inputbanerror;
  }
  
  public void setInputBanError(int i) {
    this._inputbanerror = i;
  }
  
  public AcceleratorChecker getAcceleratorChecker() {
    return this._acceleratorChecker;
  }
  
  public int getSlot() {
    return this._Slot;
  }
  
  public void setSlot(int i) {
    this._Slot = i;
  }
  
  public boolean isItemPoly() {
    return this._itempoly;
  }
  
  public void setItemPoly(boolean itempoly) {
    this._itempoly = itempoly;
  }
  
  public boolean isItemPoly1() {
    return this._itempoly1;
  }
  
  public void setItemPoly1(boolean itempoly1) {
    this._itempoly1 = itempoly1;
  }
  
  public L1ItemInstance getPolyScroll() {
    return this._polyscroll;
  }
  
  public void setPolyScroll(L1ItemInstance item) {
    this._polyscroll = item;
  }
  
  public L1ItemInstance getPolyScrol2() {
    return this._polyscrol2;
  }
  
  public void setPolyScrol2(L1ItemInstance item) {
    this._polyscrol2 = item;
  }
  
  public void setitembox(L1ItemInstance item) {
    this._itembox = item;
  }
  
  public L1ItemInstance getitembox() {
    return this._itembox;
  }
  
  public L1EffectInstance get_tomb() {
    return this._tomb;
  }
  
  public void set_tomb(L1EffectInstance tomb) {
    this._tomb = tomb;
  }
  
  public boolean isMagicCritical() {
    return this._isMagicCritical;
  }
  
  public void setMagicCritical(boolean flag) {
    this._isMagicCritical = flag;
  }
  
  public boolean isPhantomTeleport() {
    return this._isPhantomTeleport;
  }
  
  public void setPhantomTeleport(boolean flag) {
    this._isPhantomTeleport = flag;
  }
  
  public int getRocksPrisonTime() {
    return this._rocksPrisonTime;
  }
  
  public void setRocksPrisonTime(int time) {
    this._rocksPrisonTime = time;
  }
  
  public int getLastabardTime() {
    return this._lastabardTime;
  }
  
  public void setLastabardTime(int time) {
    this._lastabardTime = time;
  }
  
  public int getIvoryTowerTime() {
    return this._ivorytowerTime;
  }
  
  public void setIvoryTowerTime(int time) {
    this._ivorytowerTime = time;
  }
  
  public int getDragonValleyTime() {
    return this._dragonvalleyTime;
  }
  
  public void setDragonValleyTime(int time) {
    this._dragonvalleyTime = time;
  }
  
  public void resetAllMapTime() {
    this._rocksPrisonTime = 0;
    this._lastabardTime = 0;
    this._ivorytowerTime = 0;
    this._dragonvalleyTime = 0;
  }
  
  public int getMapUseTime(int mapid) {
    int result = 0;
    switch (mapid) {
      case 53:
      case 54:
      case 55:
      case 56:
      case 807:
      case 808:
      case 809:
      case 810:
      case 811:
      case 812:
      case 813:
        result = this._rocksPrisonTime;
        break;
      case 75:
      case 76:
      case 77:
      case 78:
      case 79:
      case 80:
      case 81:
      case 82:
        result = this._ivorytowerTime;
        break;
      case 452:
      case 453:
      case 461:
      case 462:
      case 471:
      case 475:
      case 479:
      case 492:
      case 495:
        result = this._lastabardTime;
        break;
      case 30:
      case 31:
      case 32:
      case 33:
      case 35:
      case 36:
      case 37:
        result = this._dragonvalleyTime;
        break;
    } 
    return result;
  }
  
  public void setMapUseTime(int mapid, int time) {
    switch (mapid) {
      case 53:
      case 54:
      case 55:
      case 56:
      case 807:
      case 808:
      case 809:
      case 810:
      case 811:
      case 812:
      case 813:
        setRocksPrisonTime(time);
        break;
      case 75:
      case 76:
      case 77:
      case 78:
      case 79:
      case 80:
      case 81:
      case 82:
        setIvoryTowerTime(time);
        break;
      case 452:
      case 453:
      case 461:
      case 462:
      case 471:
      case 475:
      case 479:
      case 492:
      case 495:
        setLastabardTime(time);
        break;
      case 30:
      case 31:
      case 32:
      case 33:
      case 35:
      case 36:
      case 37:
        setDragonValleyTime(time);
        break;
    } 
  }
  
  public boolean isInTimeMap() {
    int map = getMapId();
    int maxMapUsetime = MapsTable.get().getMapTime(map);
    return (maxMapUsetime > 0);
  }
  
  public void updateMapTime(int time) {
    int mapid = getMapId();
    if (mapid >= 4001 && mapid <= 4050)
      mapid = 4001; 
    if (this.mapTime.get(Integer.valueOf(mapid)) == null)
      return; 
    int temp = ((Integer)this.mapTime.get(Integer.valueOf(mapid))).intValue();
    this.mapTime.put(Integer.valueOf(getMapId()), Integer.valueOf(temp + time));
  }
  
  public int getMapTime(int mapid) {
    if (this.mapTime.get(Integer.valueOf(mapid)) == null) {
      _log.error("记时地图ID:" + mapid + "不存在");
      return -1;
    } 
    return ((Integer)this.mapTime.get(Integer.valueOf(mapid))).intValue();
  }
  
  public ConcurrentHashMap<Integer, Integer> getMapTime() {
    return this.mapTime;
  }
  
  public void setMapTime(ConcurrentHashMap<Integer, Integer> map) {
    this.mapTime = map;
  }
  
  public boolean isTimeMap() {
    return this.isTimeMap;
  }
  
  public void setTimeMap(boolean isTimeMap) {
    this.isTimeMap = isTimeMap;
  }
  
  public void stopTimeMap() {
    if (this.isTimeMap)
      this.isTimeMap = false; 
  }
  
  public void startTimeMap() {
    if (!this.isTimeMap)
      this.isTimeMap = true; 
  }
  
  public int getClanMemberId() {
    return this._clanMemberId;
  }
  
  public void setClanMemberId(int i) {
    this._clanMemberId = i;
  }
  
  public String getClanMemberNotes() {
    return this._clanMemberNotes;
  }
  
  public void setClanMemberNotes(String s) {
    this._clanMemberNotes = s;
  }
  
  public void addStunLevel(int add) {
    this._stunlevel += add;
  }
  
  public int getStunLevel() {
    return this._stunlevel;
  }
  
  public int getother_ReductionDmg() {
    return this._other_ReductionDmg;
  }
  
  public void setother_ReductionDmg(int i) {
    this._other_ReductionDmg = i;
  }
  
  public void addother_ReductionDmg(int i) {
    this._other_ReductionDmg += i;
  }
  
  public int getClan_ReductionDmg() {
    return this._Clan_ReductionDmg;
  }
  
  public void setClan_ReductionDmg(int i) {
    this._Clan_ReductionDmg = i;
  }
  
  public void addClan_ReductionDmg(int i) {
    this._Clan_ReductionDmg += i;
  }
  
  public void add_Clanmagic_reduction_dmg(int add) {
    this._Clanmagic_reduction_dmg += add;
  }
  
  public int get_Clanmagic_reduction_dmg() {
    return this._Clanmagic_reduction_dmg;
  }
  
  public void addExpByArmor(double i) {
    this._addExpByArmor += i;
  }
  
  public double getExpByArmor() {
    return this._addExpByArmor;
  }
  
  public int getPcContribution() {
    return this._PcContribution;
  }
  
  public void setPcContribution(int i) {
    this._PcContribution = i;
  }
  
  public int getClanContribution() {
    return this._clanContribution;
  }
  
  public void setClanContribution(int i) {
    this._clanContribution = i;
  }
  
  public int getclanadena() {
    return this._clanadena;
  }
  
  public void setclanadena(int i) {
    this._clanadena = i;
  }
  
  public String getClanNameContribution() {
    return this.clanNameContribution;
  }
  
  public void setClanNameContribution(String s) {
    this.clanNameContribution = s;
  }
  
  public void setcheckgm(boolean checkgm) {
    this._checkgm = checkgm;
  }
  
  public boolean getcheckgm() {
    return this._checkgm;
  }
  
  public void setcheck_lv(boolean b) {
    this.check_lv = b;
  }
  
  public boolean getcheck_lv() {
    return this.check_lv;
  }
  
  public int getlogpcpower_SkillCount() {
    return this._logpcpower_SkillCount;
  }
  
  public void setlogpcpower_SkillCount(int i) {
    this._logpcpower_SkillCount = i;
  }
  
  public int getlogpcpower_SkillFor1() {
    return this._logpcpower_SkillFor1;
  }
  
  public void setlogpcpower_SkillFor1(int i) {
    this._logpcpower_SkillFor1 = i;
  }
  
  public int getlogpcpower_SkillFor2() {
    return this._logpcpower_SkillFor2;
  }
  
  public void setlogpcpower_SkillFor2(int i) {
    this._logpcpower_SkillFor2 = i;
  }
  
  public int getlogpcpower_SkillFor3() {
    return this._logpcpower_SkillFor3;
  }
  
  public void setlogpcpower_SkillFor3(int i) {
    this._logpcpower_SkillFor3 = i;
  }
  
  public int getlogpcpower_SkillFor4() {
    return this._logpcpower_SkillFor4;
  }
  
  public void setlogpcpower_SkillFor4(int i) {
    this._logpcpower_SkillFor4 = i;
  }
  
  public int getlogpcpower_SkillFor5() {
    return this._logpcpower_SkillFor5;
  }
  
  public void setlogpcpower_SkillFor5(int i) {
    this._logpcpower_SkillFor5 = i;
  }
  
  public int getEsotericSkill() {
    return this._EsotericSkill;
  }
  
  public void setEsotericSkill(int i) {
    this._EsotericSkill = i;
  }
  
  public int getEsotericCount() {
    return this._EsotericCount;
  }
  
  public void setEsotericCount(int i) {
    this._EsotericCount = i;
  }
  
  public boolean isEsoteric() {
    return this._isEsoteric;
  }
  
  public void setEsoteric(boolean flag) {
    this._isEsoteric = flag;
  }
  
  public boolean isTripleArrow() {
    return this._TripleArrow;
  }
  
  public void setTripleArrow(boolean TripleArrow) {
    this._TripleArrow = TripleArrow;
  }
  
  public void setchecklogpc(boolean checklogpc) {
    this._checklogpc = checklogpc;
  }
  
  public boolean getchecklogpc() {
    return this._checklogpc;
  }
  
  public int gesavepclog() {
    return this._savepclog;
  }
  
  public void setsavepclog(int i) {
    this._savepclog = i;
  }
  
  public int getReductionDmg() {
    return this._ReductionDmg;
  }
  
  public void setReductionDmg(int i) {
    this._ReductionDmg = i;
  }
  
  public int getpcdmg() {
    return this._pcdmg;
  }
  
  public void setpcdmg(int i) {
    this._pcdmg = i;
  }
  
  public int getpaycount() {
    return this._paycount;
  }
  
  public void setpaycount(int i) {
    this._paycount = i;
  }
  
  public int getArmorCount1() {
    return this._ArmorCount1;
  }
  
  public void setArmorCount1(int i) {
    this._ArmorCount1 = i;
  }
  
  public int getlogintime() {
    return this._logintime;
  }
  
  public void setlogintime(int i) {
    this._logintime = i;
  }
  
  public int getlogintime1() {
    return this._logintime1;
  }
  
  public void setlogintime1(int i) {
    this._logintime1 = i;
  }
  
  public double getPartyExp() {
    return this._PartyExp;
  }
  
  public void setPartyExp(double d) {
    this._PartyExp = d;
  }
  
  public boolean getATK_ai() {
    return this.ATK_ai;
  }
  
  public void setATK_ai(boolean b) {
    this.ATK_ai = b;
  }
  
  public final long getShopAdenaRecord() {
    return this._shopAdenaRecord;
  }
  
  public final void setShopAdenaRecord(long i) {
    this._shopAdenaRecord = i;
  }
  
  public int getdolldamageReductionByArmor() {
    int dolldamageReduction = 0;
    if (this._dolldamageReductionByArmor > 10) {
      dolldamageReduction = 10 + _random.nextInt(this._dolldamageReductionByArmor - 10) + 1;
    } else {
      dolldamageReduction = this._dolldamageReductionByArmor;
    } 
    return dolldamageReduction;
  }
  
  public void adddollDamageReductionByArmor(int i) {
    this._dolldamageReductionByArmor += i;
  }
  
  public void addweaponMD(int weaponMD) {
    this._weaponMD += weaponMD;
  }
  
  public int getweaponMD() {
    return this._weaponMD;
  }
  
  public void addweaponMDC(int weaponMDC) {
    this._weaponMDC += weaponMDC;
  }
  
  public int getweaponMDC() {
    return this._weaponMDC;
  }
  
  public void add_reduction_dmg(int add) {
    this._reduction_dmg += add;
  }
  
  public int get_reduction_dmg() {
    return this._reduction_dmg;
  }
  
  public void addSkin(L1SkinInstance skin, int gfxid) {
    this._skins.put(Integer.valueOf(gfxid), skin);
  }
  
  public void addGF(int i) {
    if (i > 0) {
      this._GF = DoubleUtil.sum(this._GF, i / 100.0D);
    } else {
      this._GF = DoubleUtil.sub(this._GF, (i * -1) / 100.0D);
    } 
  }
  
  public double getGF() {
    if (this._GF < 0.0D)
      return 0.0D; 
    return this._GF;
  }
  
  public void removeSkin(int gfxid) {
    this._skins.remove(Integer.valueOf(gfxid));
  }
  
  public L1SkinInstance getSkin(int gfxid) {
    return this._skins.get(Integer.valueOf(gfxid));
  }
  
  public Map<Integer, L1SkinInstance> getSkins() {
    return this._skins;
  }
  
  public boolean get_isTeleportToOk() {
    return this._isTeleportToOk;
  }
  
  public void set_isTeleportToOk(boolean b) {
    this._isTeleportToOk = b;
  }
  
  public boolean get_MOVE_STOP() {
    return this._MOVE_STOP;
  }
  
  public void set_MOVE_STOP(boolean b) {
    this._MOVE_STOP = b;
  }
  
  public void sendPacketsBossWeaponAll(ServerBasePacket packet) {
    if (this._out == null)
      return; 
    try {
      this._out.encrypt(packet);
      if (!isGmInvis() && !isInvisble())
        broadcastPacketBossWeaponAll(packet); 
    } catch (Exception e) {
      logout();
      close();
    } 
  }
  
  public String getIp() {
    return this._netConnection.getIp().toString();
  }
  
  public int getAmount() {
    return this._amount;
  }
  
  public void setAmount(int i) {
    this._amount = i;
  }
  
  public synchronized void setExp_Direct(long i) {
    setExp(i);
    onChangeExp();
  }
  
  public L1Inventory getTradeWindowInventory() {
    return this._tradewindow;
  }
  
  public long get_consume_point() {
    return this._consume_point;
  }
  
  public void set_consume_point(long count) {
    this._consume_point = count;
  }
  
  public final void setMapsList(HashMap<Integer, Integer> list) {
    this._mapsList = list;
  }
  
  public final int getMapsTime(int key) {
    if (this._mapsList == null || !this._mapsList.containsKey(Integer.valueOf(key)))
      return 0; 
    return ((Integer)this._mapsList.get(Integer.valueOf(key))).intValue();
  }
  
  public void putMapsTime(int key, int value) {
    if (this._mapsList == null)
      this._mapsList = CharMapTimeReading.get().addTime(getId(), key, value); 
    this._mapsList.put(Integer.valueOf(key), Integer.valueOf(value));
  }
  
  public int getTempStr() {
    return this._tempStr;
  }
  
  public void setTempStr(int i) {
    this._tempStr = i;
  }
  
  public int getTempDex() {
    return this._tempDex;
  }
  
  public void setTempDex(int i) {
    this._tempDex = i;
  }
  
  public int getTempCon() {
    return this._tempCon;
  }
  
  public void setTempCon(int i) {
    this._tempCon = i;
  }
  
  public int getTempWis() {
    return this._tempWis;
  }
  
  public void setTempWis(int i) {
    this._tempWis = i;
  }
  
  public int getTempCha() {
    return this._tempCha;
  }
  
  public void setTempCha(int i) {
    this._tempCha = i;
  }
  
  public int getTempInt() {
    return this._tempInt;
  }
  
  public void setTempInt(int i) {
    this._tempInt = i;
  }
  
  public int getTempInitPoint() {
    return this._tempInitPoint;
  }
  
  public void setTempInitPoint(int i) {
    this._tempInitPoint = i;
  }
  
  public int getTempElixirstats() {
    return this._tempElixirstats;
  }
  
  public void setTempElixirstats(int i) {
    this._tempElixirstats = i;
  }
  
  public int getweapondmg() {
    return this.weapondmg;
  }
  
  public void setweapondmg(int i) {
    this.weapondmg = i;
  }
  
  public int getDmgdouble() {
    return this.Dmgdouble;
  }
  
  public void setDmgdouble(double Dmgdouble) {
    Dmgdouble += Dmgdouble;
  }
  
  public int[] getReward_Weapon() {
    return this._reward_Weapon;
  }
  
  public void setReward_Weapon(int[] i) {
    this._reward_Weapon = i;
  }
  
  public int getelfweapon() {
    return this.elfweapon;
  }
  
  public void setelfweapon(int i) {
    this.elfweapon = i;
  }
  
  public int getPVPdmg() {
    return this._PVPdmg;
  }
  
  public void setPVPdmg(int i) {
    this._PVPdmg = i;
  }
  
  public void addPVPdmg(int i) {
    this._PVPdmg += i;
  }
  
  public int getPVPdmgReduction() {
    return this._PVPdmgReduction;
  }
  
  public void setPVPdmgReduction(int i) {
    this._PVPdmgReduction = i;
  }
  
  public void addPVPdmgReduction(int i) {
    this._PVPdmgReduction += i;
  }
  
  public int getattr_potion_heal() {
    return this._attr_potion_heal;
  }
  
  public void setattr_potion_heal(int i) {
    this._attr_potion_heal = i;
  }
  
  public void addattr_potion_heal(int i) {
    this._attr_potion_heal += i;
  }
  
  public int getpenetrate() {
    return this._penetrate;
  }
  
  public void setpenetrate(int i) {
    this._penetrate = i;
  }
  
  public int getattr_物理格档() {
    return this._attr_物理格档;
  }
  
  public void setattr_物理格档(int i) {
    this._attr_物理格档 = i;
  }
  
  public void addattr_物理格档(int i) {
    this._attr_物理格档 += i;
  }
  
  public int getattr_魔法格档() {
    return this._attr_魔法格档;
  }
  
  public void setattr_魔法格档(int i) {
    this._attr_魔法格档 = i;
  }
  
  public void addattr_魔法格档(int i) {
    this._attr_魔法格档 += i;
  }
  
  public int getNoweaponRedmg() {
    return this._NoweaponRedmg;
  }
  
  public void setNoweaponRedmg(int i) {
    this._NoweaponRedmg = i;
  }
  
  public int getaddStunLevel() {
    return this._addStunLevel;
  }
  
  public void setaddStunLevel(int i) {
    this._addStunLevel = i;
  }
  
  public void addaddStunLevel(int add) {
    this._addStunLevel += add;
  }
  
  public int getloginpoly() {
    return this._loginpoly;
  }
  
  public void setloginpoly(int i) {
    this._loginpoly = i;
  }
  
  public int getBackHeading() {
    return this.backHeading;
  }
  
  public void setBackHeading(int backHeading) {
    this.backHeading = backHeading;
  }
  
  public int getBackX() {
    return this.backX;
  }
  
  public void setBackX(int backX) {
    this.backX = backX;
  }
  
  public int getBackY() {
    return this.backY;
  }
  
  public void setBackY(int backY) {
    this.backY = backY;
  }
  
  public boolean isAI() {
    return this._isAI;
  }
  
  public void setAI(boolean flag) {
    this._isAI = flag;
  }
  
  public int getAi_Number() {
    return this._ai_number;
  }
  
  public void setAi_Number(int flag) {
    this._ai_number = flag;
  }
  
  public int getAi_Count() {
    return this._ai_count;
  }
  
  public void setAi_Count(int i) {
    this._ai_count = i;
  }
  
  public void addAi_Count(int i) {
    this._ai_count += i;
  }
  
  public int getAi_error() {
    return this._ai_error;
  }
  
  public void setAi_error(int i) {
    this._ai_error = i;
  }
  
  public void addAi_error(int i) {
    this._ai_error += i;
  }
  
  public int getAi_correct() {
    return this._ai_correct;
  }
  
  public void setAi_correct(int i) {
    this._ai_correct = i;
  }
  
  public void addAi_correct(int i) {
    this._ai_correct += i;
  }
  
  public void set_Imperius_Tshirt(int r, int drainingHP_min, int drainingHP_max) {
    this._Imperius_Tshirt_rnd = r;
    this._drainingHP_min = drainingHP_min;
    this._drainingHP_max = drainingHP_max;
  }
  
  public int get_Imperius_Tshirt_rnd() {
    return this._Imperius_Tshirt_rnd;
  }
  
  public int get_Tshirt_drainingHP_min() {
    return this._drainingHP_min;
  }
  
  public int get_Tshirt_drainingHP_max() {
    return this._drainingHP_max;
  }
  
  public void set_MoonAmulet(int r, int dmgmin, int dmgmax, int gfxid) {
    this._MoonAmulet_rnd = r;
    this._MoonAmulet_dmg_min = dmgmin;
    this._MoonAmulet_dmg_max = dmgmax;
    this._MoonAmulet_gfxid = gfxid;
  }
  
  public int get_MoonAmulet_rnd() {
    return this._MoonAmulet_rnd;
  }
  
  public int get_MoonAmulet_dmg_min() {
    return this._MoonAmulet_dmg_min;
  }
  
  public int get_MoonAmulet_dmg_max() {
    return this._MoonAmulet_dmg_max;
  }
  
  public int get_MoonAmulet_gfxid() {
    return this._MoonAmulet_gfxid;
  }
  
  public void set_AttrAmulet(int r, int dmg, int gfxid) {
    this._AttrAmulet_rnd = r;
    this._AttrAmulet_dmg = dmg;
    this._AttrAmulet_gfxid = gfxid;
  }
  
  public int get_AttrAmulet_rnd() {
    return this._AttrAmulet_rnd;
  }
  
  public int get_AttrAmulet_dmg() {
    return this._AttrAmulet_dmg;
  }
  
  public int get_AttrAmulet_gfxid() {
    return this._AttrAmulet_gfxid;
  }
  
  public int getRange() {
    return this._range;
  }
  
  public void setRange(int i) {
    this._range = i;
  }
  
  public PcAttackThread getAttackThread() {
    return this.attackThread;
  }
  
  public void setAttackThread(PcAttackThread attackThread) {
    this.attackThread = attackThread;
  }
  
  public int getday() {
    return this._day;
  }
  
  public void setday(int i) {
    this._day = i;
  }
  
  public void addPrestige(int i) {
    this._prestige += i;
    this._prestige = Math.max(this._prestige, 0);
    if (this._prestigeLv != RewardPrestigeTable.get().getLv(this._prestige)) {
      if (this._prestigeLv != 0)
        RewardPrestigeTable.get().removePrestige(this); 
      this._prestigeLv = RewardPrestigeTable.get().getLv(this._prestige);
      if (this._prestigeLv != 0)
        RewardPrestigeTable.get().addPrestige(this); 
      L1Teleport.teleport(this, getX(), getY(), getMapId(), getHeading(), false);
    } 
  }
  
  public int getPrestige() {
    return this._prestige;
  }
  
  public void setPrestige(int i) {
    this._prestige = i;
    if (RewardPrestigeTable.START && this._prestige == 0) {
      this._prestigeLv = RewardPrestigeTable.get().getLv(this._prestige);
      sendPackets((ServerBasePacket)new S_ServerMessage("\\fU你身上带有,阵营积分受到守护!"));
    } else if (RewardPrestigeTable.START && this._prestige != 0) {
      this._prestigeLv = RewardPrestigeTable.get().getLv(this._prestige);
    } 
  }
  
  public int getPrestigeLv() {
    return this._prestigeLv;
  }
  
  public void setgo_guajitele(boolean go_guajitele) {
    this._go_guajitele = go_guajitele;
  }
  
  public boolean getgo_guajitele() {
    return this._go_guajitele;
  }
  
  public long getoldexp() {
    return this._oldexp;
  }
  
  public void setoldexp(long oldexp) {
    this._oldexp = oldexp;
  }
  
  public boolean isItemName() {
    return this._isItemName;
  }
  
  public void setItemName(boolean flag) {
    this._isItemName = flag;
  }
  
  public boolean isItemopen() {
    return this._isItemopen;
  }
  
  public void setItemopen(boolean flag) {
    this._isItemopen = flag;
  }
  
  public boolean isfollow() {
    return this._isfollow;
  }
  
  public void setfollow(boolean flag) {
    this._isfollow = flag;
  }
  
  public boolean isfollowcheck() {
    return this._isfollowcheck;
  }
  
  public void setfollowcheck(boolean flag) {
    this._isfollowcheck = flag;
  }
  
  public int get_poisonStatus2() {
    return this._poisonStatus2;
  }
  
  public void set_poisonStatus2(int i) {
    this._poisonStatus2 = i;
  }
  
  public int get_poisonStatus7() {
    return this._poisonStatus7;
  }
  
  public void set_poisonStatus7(int i) {
    this._poisonStatus7 = i;
  }
  
  public final boolean _isCraftsmanHeirloom() {
    return this._isCraftsmanHeirloom;
  }
  
  public final void setCraftsmanHeirloom(boolean checkFlag) {
    if (this._isCraftsmanHeirloom != checkFlag) {
      giveCraftsmanHeirloom(checkFlag);
      sendPackets((ServerBasePacket)new S_HPUpdate(this));
      if (isInParty())
        getParty().updateMiniHP(this); 
      sendPackets((ServerBasePacket)new S_MPUpdate(this));
      sendPackets((ServerBasePacket)new S_SPMR(this));
      L1PcUnlock.Pc_Unlock(this);
    } 
  }
  
  public final void giveCraftsmanHeirloom(boolean checkFlag) {
    this._isCraftsmanHeirloom = checkFlag;
    if (checkFlag) {
      addMaxHp(120);
      addMaxMp(100);
      addDmgup(50);
      addSp(15);
      addDamageReductionByArmor(30);
      sendPackets((ServerBasePacket)new S_PacketBox(180, 1, 460));
    } else {
      addMaxHp(-120);
      addMaxMp(-100);
      addDmgup(-50);
      addSp(-15);
      addDamageReductionByArmor(-30);
      sendPackets((ServerBasePacket)new S_PacketBox(180, 0, 460));
    } 
  }
  
  public final boolean _isMarsSoul() {
    return this._isMarsSoul;
  }
  
  public final void setMarsSoul(boolean checkFlag) {
    if (this._isMarsSoul != checkFlag) {
      giveMarsSoul(checkFlag);
      sendPackets((ServerBasePacket)new S_HPUpdate(this));
      if (isInParty())
        getParty().updateMiniHP(this); 
      sendPackets((ServerBasePacket)new S_MPUpdate(this));
      sendPackets((ServerBasePacket)new S_SPMR(this));
      L1PcUnlock.Pc_Unlock(this);
    } 
  }
  
  public final void giveMarsSoul(boolean checkFlag) {
    this._isMarsSoul = checkFlag;
    if (checkFlag) {
      addMaxHp(120);
      addMaxMp(100);
      addDmgup(15);
      addBowDmgup(15);
      addSp(5);
      addDamageReductionByArmor(8);
      sendPackets((ServerBasePacket)new S_PacketBox(180, 1, 457));
    } else {
      addMaxHp(-120);
      addMaxMp(-100);
      addDmgup(-15);
      addBowDmgup(-15);
      addSp(-5);
      addDamageReductionByArmor(-8);
      sendPackets((ServerBasePacket)new S_PacketBox(180, 0, 457));
    } 
  }
  
  public int getSuper() {
    return this._super;
  }
  
  public void setSuper(int i) {
    this._super = i;
  }
  
  public void setguaji_poly(int b) {
    this.guaji_poly = b;
  }
  
  public int getguaji_poly() {
    return this.guaji_poly;
  }
  
  public int getIceTime() {
    return this._iceTime;
  }
  
  public void setIceTime(int time) {
    this._iceTime = time;
  }
  
  public void startAI() {
    if (isDead())
      return; 
    if (isGhost())
      return; 
    if (getCurrentHp() <= 0)
      return; 
    if (isPrivateShop())
      return; 
    if (isParalyzed())
      return; 
    if (get_followmaster() == null)
      this._pcMove = new pcMove(this); 
    setAiRunning(true);
    setActived(true);
    PcAI npcai = new PcAI(this);
    npcai.startAI();
  }
  
  protected boolean isAiRunning() {
    return this._aiRunning;
  }
  
  protected void setAiRunning(boolean aiRunning) {
    this._aiRunning = aiRunning;
  }
  
  public void allTargetClear() {
    if (this._pcMove != null)
      this._pcMove.clear(); 
    this._hateList.clear();
    this._target = null;
    setFirstAttack(false);
  }
  
  public void checkTarget() {
    try {
      if (this._target == null) {
        allTargetClear();
        return;
      } 
      if (this._target.getMapId() != getMapId()) {
        allTargetClear();
        return;
      } 
      if (this._target.getCurrentHp() <= 0) {
        allTargetClear();
        return;
      } 
      if (this._target.isDead()) {
        allTargetClear();
        return;
      } 
      if (get_showId() != this._target.get_showId()) {
        allTargetClear();
        return;
      } 
      if (!this._hateList.containsKey(this._target)) {
        allTargetClear();
        return;
      } 
      int distance = getLocation().getTileDistance((Point)this._target.getLocation());
      if (distance > 5) {
        allTargetClear();
        return;
      } 
    } catch (Exception e) {
      return;
    } 
  }
  
  public L1Character is_now_target() {
    return this._target;
  }
  
  public void attackTarget(L1Character target) {
    if (getInventory().getWeight240() >= 197) {
      sendPackets((ServerBasePacket)new S_ServerMessage(110));
      return;
    } 
    if (hasSkillEffect(1011))
      return; 
    if (hasSkillEffect(1009))
      return; 
    if (hasSkillEffect(66))
      return; 
    if (hasSkillEffect(87))
      return; 
    if (hasSkillEffect(212))
      return; 
    if (hasSkillEffect(50))
      return; 
    if (hasSkillEffect(157))
      return; 
    if (hasSkillEffect(103))
      return; 
    if (hasSkillEffect(208))
      return; 
    if (target instanceof L1PcInstance) {
      L1PcInstance player = (L1PcInstance)target;
      if (player.isTeleport())
        return; 
      if (!player.isPinkName()) {
        allTargetClear();
        return;
      } 
    } else if (target instanceof L1PetInstance) {
      L1PetInstance pet = (L1PetInstance)target;
      L1Character cha = pet.getMaster();
      if (cha instanceof L1PcInstance) {
        L1PcInstance player2 = (L1PcInstance)cha;
        if (player2.isTeleport())
          return; 
      } 
    } else if (target instanceof L1SummonInstance) {
      L1SummonInstance summon = (L1SummonInstance)target;
      L1Character cha = summon.getMaster();
      if (cha instanceof L1PcInstance) {
        L1PcInstance player2 = (L1PcInstance)cha;
        if (player2.isTeleport())
          return; 
      } 
    } 
    if (target instanceof L1NpcInstance) {
      L1NpcInstance npc = (L1NpcInstance)target;
      if (npc.getHiddenStatus() != 0) {
        allTargetClear();
        return;
      } 
    } 
    if (target instanceof L1PetInstance) {
      allTargetClear();
      return;
    } 
    if (target.getCurrentHp() > 0 && !target.isDead())
      target.onAction(this); 
    if (((get_followmaster() == null && !getfollowatkmagic()) || (
      get_followmaster() != null && getfollowatkmagic())) && 
      getCurrentMp() >= getMaxMp() * getma1() / 100 && (
      !hasSkillEffect(1007) || !hasSkillEffect(64)))
      SkillDmg(this, target); 
  }
  
  public void searchTarget() {
    Collection<L1Object> allObj = World.get().getVisibleObjects((L1Object)this, 3);
    allObj = World.get().getVisibleObjects((L1Object)this, 3);
    Iterator<L1Object> iter = allObj.iterator();
    while (iter.hasNext()) {
      L1Object obj = iter.next();
      if (!(obj instanceof L1MonsterInstance))
        continue; 
      L1MonsterInstance mob = (L1MonsterInstance)obj;
      if (mob.getNpcTemplate().is_boss() && get_followmaster() == null) {
        L1Teleport.randomTeleport(this, true);
        this.move = 0;
        continue;
      } 
      if (mob.getNpcTemplate().get_npcId() == 81257)
        continue; 
      if (mob.hasSkillEffect(33) || mob.hasSkillEffect(50) || mob.hasSkillEffect(1011))
        continue; 
      if (mob.hasSkillEffect(1009))
        continue; 
      if (mob.isDead())
        continue; 
      if (mob.getCurrentHp() <= 0)
        continue; 
      if (mob.getHiddenStatus() > 0)
        continue; 
      if (mob.getAtkspeed() == 0)
        continue; 
      if (mob.hasSkillEffect(getId() + 100000) && !isAttackPosition(mob.getX(), mob.getY(), 1))
        continue; 
      if (getmobatk() && mob.is_now_target() != null && mob.is_now_target() != this && mob
        .isAttackPosition(mob.is_now_target().getX(), mob.is_now_target().getY(), mob.get_ranged()))
        continue; 
      if (mob == null)
        continue; 
      int Distance = 0;
      if (glanceCheck(mob.getX(), mob.getY()))
        Distance += 5; 
      this._hateList.add(mob, Distance);
    } 
    Collection<L1Object> allObj2 = World.get().getVisibleObjects((L1Object)this, 7);
    if (get_followmaster() != null) {
      allObj2 = World.get().getVisibleObjects((L1Object)this, 3);
    } else {
      allObj2 = World.get().getVisibleObjects((L1Object)this, 7);
    } 
    Iterator<L1Object> iter2 = allObj2.iterator();
    while (iter2.hasNext()) {
      L1Object obj2 = iter2.next();
      if (!(obj2 instanceof L1MonsterInstance))
        continue; 
      L1MonsterInstance mob2 = (L1MonsterInstance)obj2;
      if (mob2.getNpcTemplate().is_boss() && get_followmaster() == null) {
        L1Teleport.randomTeleport(this, true);
        this.move = 0;
        continue;
      } 
      if (mob2.getNpcTemplate().get_npcId() == 81257)
        continue; 
      if (mob2.hasSkillEffect(33) || mob2.hasSkillEffect(50) || mob2.hasSkillEffect(1011))
        continue; 
      if (mob2.hasSkillEffect(1009))
        continue; 
      if (mob2.isDead())
        continue; 
      if (mob2.getCurrentHp() <= 0)
        continue; 
      if (mob2.getHiddenStatus() > 0)
        continue; 
      if (mob2.getAtkspeed() == 0)
        continue; 
      if (mob2.hasSkillEffect(getId() + 100000) && !isAttackPosition(mob2.getX(), mob2.getY(), 1))
        continue; 
      if (getmobatk() && mob2.is_now_target() != null && mob2.is_now_target() != this && 
        mob2.isAttackPosition(mob2.is_now_target().getX(), mob2.is_now_target().getY(), 
          mob2.get_ranged()))
        continue; 
      if (mob2 == null)
        continue; 
      int Distance2 = 0;
      if (glanceCheck(mob2.getX(), mob2.getY()))
        Distance2 += 5; 
      this._hateList.add(mob2, Distance2);
    } 
    this._target = this._hateList.getMaxHateCharacter();
    if (this._target == null && getgo_guajitele() && getlslocx() == 0 && getlslocy() == 0 && 
      !hasSkillEffect(8852) && get_followmaster() == null && getMap().isTeleportable())
      if (ConfigGuaji.Guaji_tele) {
        if (!hasSkillEffect(33) || !hasSkillEffect(4000) || !hasSkillEffect(192) || 
          !hasSkillEffect(50) || !hasSkillEffect(66) || !hasSkillEffect(87) || 
          !hasSkillEffect(4017) || !hasSkillEffect(192) || !hasSkillEffect(157)) {
          L1Teleport.randomTeleportai(this);
          this.move = 0;
          setSkillEffect(8852, 2000);
        } 
      } else if (!ConfigGuaji.Guaji_tele && 
        getInventory().checkItem(ConfigGuaji.Guaji_tele_item, ConfigGuaji.Guaji_tele_itemcount) && (
        !hasSkillEffect(33) || !hasSkillEffect(4000) || !hasSkillEffect(192) || 
        !hasSkillEffect(50) || !hasSkillEffect(66) || !hasSkillEffect(87) || 
        !hasSkillEffect(4017) || !hasSkillEffect(192) || !hasSkillEffect(157))) {
        getInventory().consumeItem(ConfigGuaji.Guaji_tele_item, ConfigGuaji.Guaji_tele_itemcount);
        L1Teleport.randomTeleportai(this);
        this.move = 0;
        setSkillEffect(8852, 2000);
      }  
    allObj.clear();
    allObj2.clear();
  }
  
  public void targetClear() {
    if (this._target == null)
      return; 
    this._hateList.remove(this._target);
    this._target = null;
  }
  
  public void onTarget() {
    try {
      L1Character target = this._target;
      if (target == null)
        return; 
      attack(target);
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
    } 
  }
  
  private void attack(L1Character target) {
    int attack_Range = 1;
    if (getWeapon() != null)
      if (get_followmaster() == null) {
        attack_Range = getWeapon().getItem().getRange();
      } else {
        attack_Range = 3;
      }  
    if (attack_Range < 0)
      attack_Range = 9; 
    if (isAttackPosition(target.getX(), target.getY(), attack_Range)) {
      setHeading(targetDirection(target.getX(), target.getY()));
      attackTarget(target);
      this.move = 0;
      if (this._pcMove != null)
        this._pcMove.clear(); 
    } else if (this._pcMove != null) {
      int dir = this._pcMove.moveDirection(target.getX(), target.getY());
      if (dir == -1) {
        this._target.setSkillEffect(getId() + 100000, 20000);
        allTargetClear();
      } else {
        this._pcMove.setDirectionMove(dir);
        this.move++;
      } 
    } 
  }
  
  public boolean isActived() {
    return this._actived;
  }
  
  public void setActived(boolean actived) {
    this._actived = actived;
  }
  
  protected boolean isFirstAttack() {
    return this._firstAttack;
  }
  
  protected void setFirstAttack(boolean firstAttack) {
    this._firstAttack = firstAttack;
  }
  
  public void setHate(L1Character cha, int hate) {
    try {
      if (cha != null && this._target != null && !isFirstAttack() && hate > 0) {
        setFirstAttack(true);
        if (this._pcMove != null)
          this._pcMove.clear(); 
        this._hateList.add(cha, 5);
        this._target = this._hateList.getMaxHateCharacter();
        checkTarget();
      } 
    } catch (Exception e) {
      return;
    } 
  }
  
  public boolean isPathfinding() {
    return this._Pathfinding;
  }
  
  public void setPathfinding(boolean fla) {
    this._Pathfinding = fla;
  }
  
  public int getrandomMoveDirection() {
    return this._randomMoveDirection;
  }
  
  public void setrandomMoveDirection(int randomMoveDirection) {
    this._randomMoveDirection = randomMoveDirection;
  }
  
  public void noTarget() {
    if (hasSkillEffect(1011))
      return; 
    if (hasSkillEffect(1009))
      return; 
    if (hasSkillEffect(4000))
      return; 
    if (!this._Pathfinding)
      this._Pathfinding = true; 
    if (this._randomMoveDirection > 7)
      this._randomMoveDirection = 0; 
    if (this._pcMove != null && getrandomMoveDirection() < 8) {
      int dir = this._pcMove.checkObject(this._randomMoveDirection);
      dir = this._pcMove.openDoor(dir);
      if (dir != -1) {
        this._pcMove.setDirectionMove(dir);
      } else {
        this._randomMoveDirection = _random.nextInt(8);
        this.move++;
      } 
    } 
  }
  
  public int getguajiX() {
    return this._tguajiX;
  }
  
  public void setguajiX(int i) {
    this._tguajiX = i;
  }
  
  public int getguajiY() {
    return this._tguajiY;
  }
  
  public void setguajiY(int i) {
    this._tguajiY = i;
  }
  
  public int getguajiMapId() {
    return this._guajiMapId;
  }
  
  public void setguajiMapId(int i) {
    this._guajiMapId = i;
  }
  
  public void addArmorBreakLevel(int add) {
    this._armorbreaklevel += add;
  }
  
  public int getArmorBreakLevel() {
    return this._armorbreaklevel;
  }
  
  public int get_FoeSlayerBonusDmg() {
    return this._FoeSlayerBonusDmg;
  }
  
  public void add_FoeSlayerBonusDmg(int Dmg) {
    this._FoeSlayerBonusDmg += Dmg;
  }
  
  public void set_soulHp_val(int r, int hpmin, int hpmax) {
    this._soulHp_r = r;
    this._soulHp_hpmin = hpmin;
    this._soulHp_hpmax = hpmax;
  }
  
  public int isSoulHp() {
    return this.isSoulHp;
  }
  
  public ArrayList<Integer> get_soulHp() {
    this.soulHp.add(0, Integer.valueOf(this._soulHp_r));
    this.soulHp.add(1, Integer.valueOf(this._soulHp_hpmin));
    this.soulHp.add(2, Integer.valueOf(this._soulHp_hpmax));
    return this.soulHp;
  }
  
  public void set_soulHp(int flag) {
    this.isSoulHp = flag;
  }
  
  public String getoldtitle() {
    return this.oldtitle;
  }
  
  public void setoldtitle(String s) {
    this.oldtitle = s;
  }
  
  public final void setvipname1() {
    sendPackets((ServerBasePacket)new S_HPUpdate(this));
    if (isInParty())
      getParty().updateMiniHP(this); 
    sendPackets((ServerBasePacket)new S_MPUpdate(this));
    sendPackets((ServerBasePacket)new S_SPMR(this));
    sendPackets((ServerBasePacket)new S_OwnCharStatus(this));
    sendPackets((ServerBasePacket)new S_OwnCharPack(this));
    removeAllKnownObjects();
    updateObject();
  }
  
  public String getvipname() {
    return this.vipname;
  }
  
  public void setvipname(String s) {
    this.vipname = s;
  }
  
  public int get_PVPdmgg() {
    return this._PVPdmgg;
  }
  
  public void add_PVPdmgg(int i) {
    this._PVPdmgg += i;
  }
  
  public int get_potion_healling() {
    return this._potion_healling;
  }
  
  public void add_potion_healling(int i) {
    this._potion_healling += i;
  }
  
  public int get_potion_heal() {
    return this._potion_heal;
  }
  
  public void add_potion_heal(int i) {
    this._potion_heal += i;
  }
  
  public void startPcRewardPrestigeGfxTimer(int gfx, int time) {
    (this._gfxTimer4 = new L1PcRewardPrestigeGfxTimer(this, gfx, time)).start();
  }
  
  public void stopPcRewardPrestigeGfxTimer() {
    if (this._gfxTimer4 != null) {
      this._gfxTimer4.cancel();
      this._gfxTimer4 = null;
    } 
  }
  
  public int getWeaponSkillChance() {
    return this._weaponSkillChance;
  }
  
  public void setWeaponSkillChance(int i) {
    this._weaponSkillChance = i;
  }
  
  public double getWeaponSkillDmg() {
    return this._addWeaponSkillDmg;
  }
  
  public void setWeaponSkillDmg(double d) {
    this._addWeaponSkillDmg = d;
  }
  
  public String getnewaititle() {
    return this.newaititle;
  }
  
  public void setnewaititle(String s) {
    this.newaititle = s;
  }
  
  public void setnewaicount(int i) {
    this._newaicount = i;
  }
  
  public int getnewaicount() {
    return this._newaicount;
  }
  
  public void setproctctran(int i) {
    this._proctctran = i;
  }
  
  public int getproctctran() {
    return this._proctctran;
  }
  
  public void setnewcharpra(boolean newcharpra) {
    this._newcharpra = newcharpra;
  }
  
  public boolean getnewcharpra() {
    return this._newcharpra;
  }
  
  public int get_fwgj() {
    return this._fwgj;
  }
  
  public void set_fwgj(int fwgj) {
    this._fwgj = fwgj;
  }
  
  public int getlslocx() {
    return this._lslocx;
  }
  
  public void setlslocx(int i) {
    this._lslocx = i;
  }
  
  public int getlslocy() {
    return this._lslocy;
  }
  
  public void setlslocy(int i) {
    this._lslocy = i;
  }
  
  public void setguaji_count(int i) {
    this._guaji_count = i;
  }
  
  public int getguaji_count() {
    return this._guaji_count;
  }
  
  public void setaibig(int i) {
    this._aibig = i;
  }
  
  public int getaibig() {
    return this._aibig;
  }
  
  public void setaismall(int i) {
    this._aismall = i;
  }
  
  public int getaismall() {
    return this._aismall;
  }
  
  public void setnewaicount_2(int i) {
    this._newaicount_2 = i;
  }
  
  public int getnewaicount_2() {
    return this._newaicount_2;
  }
  
  public void setopengfxid(boolean opengfxid) {
    this._opengfxid = opengfxid;
  }
  
  public boolean getopengfxid() {
    return this._opengfxid;
  }
  
  public void removeAICheck(int itemid, long count) {
    if (this != null)
      getInventory().consumeItem(itemid); 
  }
  
  public int getAiGxfxid() {
    return this._AiGxfxid;
  }
  
  public void setAiGxfxid(int i) {
    this._AiGxfxid = i;
  }
  
  public int getAierror() {
    return this._Aierror;
  }
  
  public void setAierror(int i) {
    this._Aierror = i;
  }
  
  public int getAdd_Er() {
    return this._add_er;
  }
  
  public void setAdd_Er(int add_er) {
    this._add_er = add_er;
  }
  
  public int getMoveErrorCount() {
    return this.moveErrorCount;
  }
  
  public void setMoveErrorCount(int moveErrorCount) {
    this.moveErrorCount = moveErrorCount;
  }
  
  public boolean isMoveStatus() {
    return this.moveStatus;
  }
  
  public void setMoveStatus(boolean moveStatus) {
    this.moveStatus = moveStatus;
  }
  
  public void setfollowskilltype(int followskilltype) {
    this._followskilltype = followskilltype;
  }
  
  public int getfollowskilltype() {
    return this._followskilltype;
  }
  
  public void setfollowskillhp(int followskillhp) {
    this._followskillhp = followskillhp;
  }
  
  public int getfollowskillhp() {
    return this._followskillhp;
  }
  
  public void setfollowmebuff(boolean followmebuff) {
    this._followmebuff = followmebuff;
  }
  
  public boolean getfollowmebuff() {
    return this._followmebuff;
  }
  
  public int getItemBlendcheckitem() {
    return this._ItemBlendcheckitem;
  }
  
  public void setItemBlendcheckitem(int i) {
    this._ItemBlendcheckitem = i;
  }
  
  public String get_ItemBlendcheckitemname() {
    return this._ItemBlendcheckitemname;
  }
  
  public void set_ItemBlendcheckitemname(String s) {
    this._ItemBlendcheckitemname = s;
  }
  
  public int getItemBlendcheckitemcount() {
    return this._ItemBlendcheckitemcount;
  }
  
  public void setItemBlendcheckitemcount(int i) {
    this._ItemBlendcheckitemcount = i;
  }
  
  public int get_hppotion() {
    return this._hppotion;
  }
  
  public void add_hppotion(int i) {
    this._hppotion += i;
  }
  
  public int get_pvp() {
    return this._pvp;
  }
  
  public void add_pvp(int i) {
    this._pvp += i;
  }
  
  public int get_bowpvp() {
    return this._bowpvp;
  }
  
  public void add_bowpvp(int i) {
    this._bowpvp += i;
  }
  
  public void setfollowxy1(int followxy1) {
    this._followxy1 = followxy1;
  }
  
  public int getfollowxy1() {
    return this._followxy1;
  }
  
  public void setpolyarrow(int i) {
    this._polyarrow = i;
  }
  
  public int getpolyarrow() {
    return this._polyarrow;
  }
  
  public int getcallclanal() {
    return this.callclanal;
  }
  
  public void setcallclanal(int s) {
    this.callclanal = s;
  }
  
  public void setchangtype1(int i) {
    this._changtype1 = i;
  }
  
  public int getchangtype1() {
    return this._changtype1;
  }
  
  public void setchangtype2(int i) {
    this._changtype2 = i;
  }
  
  public int getchangtype2() {
    return this._changtype2;
  }
  
  public void setchangtype3(int i) {
    this._changtype3 = i;
  }
  
  public int getchangtype3() {
    return this._changtype3;
  }
  
  public void setchangtype4(int i) {
    this._changtype4 = i;
  }
  
  public int getchangtype4() {
    return this._changtype4;
  }
  
  public void setchangtype5(int i) {
    this._changtype5 = i;
  }
  
  public int getchangtype5() {
    return this._changtype5;
  }
  
  public String getchangtypename1() {
    return this.changtypename1;
  }
  
  public void setchangtypename1(String s) {
    this.changtypename1 = s;
  }
  
  public String getchangtypename2() {
    return this.changtypename2;
  }
  
  public void setchangtypename2(String s) {
    this.changtypename2 = s;
  }
  
  public String getchangtypename3() {
    return this.changtypename3;
  }
  
  public void setchangtypename3(String s) {
    this.changtypename3 = s;
  }
  
  public String getchangtypename4() {
    return this.changtypename4;
  }
  
  public void setchangtypename4(String s) {
    this.changtypename4 = s;
  }
  
  public void setpag(int i) {
    this._pag = i;
  }
  
  public int getpag() {
    return this._pag;
  }
  
  public boolean IsKeyInEnemy() {
    return this._keyenemy;
  }
  
  public void setKeyInEnemy(boolean b) {
    this._keyenemy = b;
  }
  
  public void setInEnemyList(String id) {
    if (!this._attackenemy.contains(new String(id)))
      this._attackenemy.add(new String(id)); 
  }
  
  public void removeInEnemyList(String id) {
    if (this._attackenemy.contains(new String(id)))
      this._attackenemy.remove(new String(id)); 
  }
  
  public boolean isInEnemyList(String id) {
    return this._attackenemy.contains(new String(id));
  }
  
  public ArrayList<String> InEnemyList() {
    return this._attackenemy;
  }
  
  public void clearInEnemyList() {
    this._attackenemy.clear();
  }
  
  public boolean IsKeyOutEnemy() {
    return this._outenemy;
  }
  
  public void setKeyOutEnemy(boolean b) {
    this._outenemy = b;
  }
  
  public boolean IsEnemyTeleport() {
    return this._enemyteleport;
  }
  
  public void setIsEnemyTeleport(boolean b) {
    this._enemyteleport = b;
  }
  
  public boolean IsAttackTeleport() {
    return this._attackteleport;
  }
  
  public void setIsAttackTeleport(boolean b) {
    this._attackteleport = b;
  }
  
  public boolean isBuffSkillList(Integer id) {
    return this._autobuff.contains(new Integer(id.intValue()));
  }
  
  public ArrayList<Integer> BuffSkillList() {
    return this._autobuff;
  }
  
  public int BuffSkillSize() {
    return this._autobuff.size();
  }
  
  public void clearBuffSkillList() {
    this._autobuff.clear();
  }
  
  public void setBuffSkillList(Integer id) {
    if (!this._autobuff.contains(new Integer(id.intValue())))
      this._autobuff.add(new Integer(id.intValue())); 
  }
  
  public boolean isAttackSkillList(Integer id) {
    return this._autoattack.contains(new Integer(id.intValue()));
  }
  
  public int AttackSkillSize() {
    return this._autoattack.size();
  }
  
  public int AttackSkillId() {
    int id = _random.nextInt(this._autoattack.size());
    if (id == this._autoattack.size())
      id--; 
    int skillid = ((Integer)this._autoattack.get(id)).intValue();
    return skillid;
  }
  
  public void clearAttackSkillList() {
    this._autoattack.clear();
  }
  
  public void setAttackSkillList(Integer id) {
    if (!this._autoattack.contains(new Integer(id.intValue())))
      this._autoattack.add(new Integer(id.intValue())); 
  }
  
  public ArrayList<Integer> AttackSkillList() {
    return this._autoattack;
  }
  
  public boolean IsBuffSkill() {
    return this._buffskill;
  }
  
  public void setBuffSkill(boolean b) {
    this._buffskill = b;
  }
  
  public boolean IsAttackSkill() {
    return this._attackskill;
  }
  
  public void setAttackSkill(boolean b) {
    this._attackskill = b;
  }
  
  public void setitempotion(int itempotion) {
    this._itempotion = itempotion;
  }
  
  public int getitempotion() {
    return this._itempotion;
  }
  
  public void setitempotion1(int itempotion1) {
    this._itempotion1 = itempotion1;
  }
  
  public int getitempotion1() {
    return this._itempotion1;
  }
  
  public void setitempotion2(int itempotion2) {
    this._itempotion2 = itempotion2;
  }
  
  public int getitempotion2() {
    return this._itempotion2;
  }
  
  public void setitemitemid(int itemitemid) {
    this._itemitemid = itemitemid;
  }
  
  public int getitemitemid() {
    return this._itemitemid;
  }
  
  public void setitemitemid1(int itemitemid1) {
    this._itemitemid1 = itemitemid1;
  }
  
  public int getitemitemid1() {
    return this._itemitemid1;
  }
  
  public void setitemitemid2(int itemitemid2) {
    this._itemitemid2 = itemitemid2;
  }
  
  public int getitemitemid2() {
    return this._itemitemid2;
  }
  
  public void setitemadena(int itemadena) {
    this._itemadena = itemadena;
  }
  
  public int getitemadena() {
    return this._itemadena;
  }
  
  public void setitemadena1(int itemadena1) {
    this._itemadena1 = itemadena1;
  }
  
  public int getitemadena1() {
    return this._itemadena1;
  }
  
  public void setitemadena2(int itemadena2) {
    this._itemadena2 = itemadena2;
  }
  
  public int getitemadena2() {
    return this._itemadena2;
  }
  
  public void setpotioncount(int potioncount) {
    this._potioncount = potioncount;
  }
  
  public int getpotioncount() {
    return this._potioncount;
  }
  
  public void setpotioncount1(int potioncount1) {
    this._potioncount1 = potioncount1;
  }
  
  public int getpotioncount1() {
    return this._potioncount1;
  }
  
  public void setpotioncount2(int potioncount2) {
    this._potioncount2 = potioncount2;
  }
  
  public int getpotioncount2() {
    return this._potioncount2;
  }
  
  public boolean getgo_guajired() {
    return this._go_guajired;
  }
  
  public void setgo_guajired(boolean flag) {
    this._go_guajired = flag;
  }
  
  public void setma1(int ma1) {
    this._ma1 = ma1;
  }
  
  public int getma1() {
    return this._ma1;
  }
  
  private boolean SkillDmg(L1PcInstance pc, L1Character targets) {
    try {
      if (pc.AttackSkillSize() > 0 && _random.nextInt(100) <= 20) {
        int skillid = pc.AttackSkillId();
        int[] MAP_IDSKILL = ConfigOther.MAP_IDSKILL;
        int[] MAP_SKILL = ConfigOther.MAP_SKILL;
        int array[], i = (array = MAP_IDSKILL).length;
        int j = 0;
        while (j < i) {
          int mapid = array[j];
          int array2[], length = (array2 = MAP_SKILL).length;
          int k = 0;
          while (k < length) {
            int mapskill = array2[k];
            if (pc.getMapId() == mapid && skillid == mapskill)
              return false; 
            k++;
          } 
          j++;
        } 
        int[] bow_GFX_Arrow = ConfigGuaji.Guaji_map_stopskill;
        int array3[], length2 = (array3 = bow_GFX_Arrow).length;
        i = 0;
        while (i < length2) {
          int gfx = array3[i];
          if (skillid == gfx && pc.isActived())
            return false; 
          i++;
        } 
        if (!pc.isSkillDelay()) {
          L1Skills skill = SkillsTable.get().getTemplate(skillid);
          L1SkillUse skillUse = new L1SkillUse();
          skillUse.handleCommands(pc, skillid, targets.getId(), targets.getX(), targets.getY(), 
              skill.getBuffDuration(), 0);
        } 
        return targets.isDead();
      } 
      return false;
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
      return false;
    } 
  }
  
  public void setnpcdmg(double d) {
    this._npcdmg = d;
  }
  
  public double getnpcdmg() {
    return this._npcdmg;
  }
  
  public int getnewai1() {
    return this._newai1;
  }
  
  public void setnewai1(int i) {
    this._newai1 = i;
  }
  
  public int getnewai2() {
    return this._newai2;
  }
  
  public void setnewai2(int i) {
    this._newai2 = i;
  }
  
  public int getnewai3() {
    return this._newai3;
  }
  
  public void setnewai3(int i) {
    this._newai3 = i;
  }
  
  public int getnewai4() {
    return this._newai4;
  }
  
  public void setnewai4(int i) {
    this._newai4 = i;
  }
  
  public int getnewai5() {
    return this._newai5;
  }
  
  public void setnewai5(int i) {
    this._newai5 = i;
  }
  
  public int getnewai6() {
    return this._newai6;
  }
  
  public void setnewai6(int i) {
    this._newai6 = i;
  }
  
  public int getnewaiq1() {
    return this._newaiq1;
  }
  
  public void setnewaiq1(int i) {
    this._newaiq1 = i;
  }
  
  public int getnewaiq2() {
    return this._newaiq2;
  }
  
  public void setnewaiq2(int i) {
    this._newaiq2 = i;
  }
  
  public int getnewaiq3() {
    return this._newaiq3;
  }
  
  public void setnewaiq3(int i) {
    this._newaiq3 = i;
  }
  
  public int getnewaiq4() {
    return this._newaiq4;
  }
  
  public void setnewaiq4(int i) {
    this._newaiq4 = i;
  }
  
  public int getnewaiq5() {
    return this._newaiq5;
  }
  
  public void setnewaiq5(int i) {
    this._newaiq5 = i;
  }
  
  public int getnewaiq6() {
    return this._newaiq6;
  }
  
  public void setnewaiq6(int i) {
    this._newaiq6 = i;
  }
  
  public int getnewaiq7() {
    return this._newaiq7;
  }
  
  public void setnewaiq7(int i) {
    this._newaiq7 = i;
  }
  
  public int getnewaiq8() {
    return this._newaiq8;
  }
  
  public void setnewaiq8(int i) {
    this._newaiq8 = i;
  }
  
  public int getnewaiq9() {
    return this._newaiq9;
  }
  
  public void setnewaiq9(int i) {
    this._newaiq9 = i;
  }
  
  public int getnewaiq0() {
    return this._newaiq0;
  }
  
  public void setnewaiq0(int i) {
    this._newaiq0 = i;
  }
  
  public int getnpciddmg() {
    return this._npciddmg;
  }
  
  public void setnpciddmg(int i) {
    this._npciddmg = i;
  }
  
  public void broadcastPacket(ServerBasePacket packet) {
    ArrayList<L1PcInstance> objs = World.get().getVisiblePlayer((L1Object)this);
    try {
      L1PcInstance pc = null;
      int i = 0;
      while (i < objs.size()) {
        pc = objs.get(i);
        if (pc.getMapId() < 16384 || pc.getMapId() > 25088)
          pc.sendPackets(packet); 
        i++;
      } 
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
    } finally {
      objs.clear();
      objs = null;
    } 
  }
  
  public void setNpcSpeed() {
    try {
      if (!getDolls().isEmpty()) {
        Object[] array;
        int length = (array = getDolls().values().toArray()).length;
        int i = 0;
        while (i < length) {
          Object obj = array[i];
          L1DollInstance doll = (L1DollInstance)obj;
          if (doll != null)
            doll.setNpcMoveSpeed(); 
          i++;
        } 
      } 
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
    } 
    try {
      if (getHierarchs() != null)
        getHierarchs().setNpcMoveSpeed(); 
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
    } 
  }
  
  public void setfollowatk(boolean followatk) {
    this._followatk = followatk;
  }
  
  public boolean getfollowatk() {
    return this._followatk;
  }
  
  public void setfollowatkmagic(boolean followatkmagic) {
    this._followatkmagic = followatkmagic;
  }
  
  public boolean getfollowatkmagic() {
    return this._followatkmagic;
  }
  
  public boolean isfollowskill26() {
    return this._isfollowskill26;
  }
  
  public void setfollowskill26(boolean flag) {
    this._isfollowskill26 = flag;
  }
  
  public boolean isfollowskill42() {
    return this._isfollowskill42;
  }
  
  public void setfollowskill42(boolean flag) {
    this._isfollowskill42 = flag;
  }
  
  public boolean isfollowskill55() {
    return this._isfollowskill55;
  }
  
  public void setfollowskill55(boolean flag) {
    this._isfollowskill55 = flag;
  }
  
  public boolean isfollowskill68() {
    return this._isfollowskill68;
  }
  
  public void setfollowskill68(boolean flag) {
    this._isfollowskill68 = flag;
  }
  
  public boolean isfollowskill160() {
    return this._isfollowskill160;
  }
  
  public void setfollowskill160(boolean flag) {
    this._isfollowskill160 = flag;
  }
  
  public boolean isfollowskill79() {
    return this._isfollowskill79;
  }
  
  public void setfollowskill79(boolean flag) {
    this._isfollowskill79 = flag;
  }
  
  public boolean isfollowskill148() {
    return this._isfollowskill148;
  }
  
  public void setfollowskill148(boolean flag) {
    this._isfollowskill148 = flag;
  }
  
  public boolean isfollowskill151() {
    return this._isfollowskill151;
  }
  
  public void setfollowskill151(boolean flag) {
    this._isfollowskill151 = flag;
  }
  
  public boolean isfollowskill149() {
    return this._isfollowskill149;
  }
  
  public void setfollowskill149(boolean flag) {
    this._isfollowskill149 = flag;
  }
  
  public boolean isfollowskill158() {
    return this._isfollowskill158;
  }
  
  public void setfollowskill158(boolean flag) {
    this._isfollowskill158 = flag;
  }
  
  public boolean isnomoveguaji() {
    return this._isnomoveguaji;
  }
  
  public void setnomoveguaji(boolean flag) {
    this._isnomoveguaji = flag;
  }
  
  public boolean IsBadKeyInEnemy() {
    return this._Badkeyenemy;
  }
  
  public void setBadKeyInEnemy(boolean b) {
    this._Badkeyenemy = b;
  }
  
  public void setBadInEnemyList(String id) {
    if (!this._Badattackenemy.contains(new String(id)))
      this._Badattackenemy.add(new String(id)); 
  }
  
  public void removeBadInEnemyList(String id) {
    if (this._Badattackenemy.contains(new String(id)))
      this._Badattackenemy.remove(new String(id)); 
  }
  
  public boolean isBadInEnemyList(String id) {
    return this._Badattackenemy.contains(new String(id));
  }
  
  public ArrayList<String> InBadEnemyList() {
    return this._Badattackenemy;
  }
  
  public void clearBadInEnemyList() {
    this._Badattackenemy.clear();
  }
  
  public boolean IsBadKeyOutEnemy() {
    return this._Badoutenemy;
  }
  
  public void setBadKeyOutEnemy(boolean b) {
    this._Badoutenemy = b;
  }
  
  public short getoldMapId() {
    return this._oldMapId;
  }
  
  public void setoldMapId(short i) {
    this._oldMapId = i;
  }
  
  public boolean getcheckpoly() {
    return this._ischeckpoly;
  }
  
  public void setcheckpoly(boolean flag) {
    this._ischeckpoly = flag;
  }
  
  public void setitemactionhtml(String itemactionhtml) {
    this._itemactionhtml = itemactionhtml;
  }
  
  public String getitemactionhtml() {
    return this._itemactionhtml;
  }
  
  public boolean getOutbur() {
    return this._isOutbur;
  }
  
  public void setOutbur(boolean flag) {
    this._isOutbur = flag;
  }
  
  public boolean getcheckOutbur() {
    return this._ischeckOutbur;
  }
  
  public void setcheckOutbur(boolean flag) {
    this._ischeckOutbur = flag;
  }
  
  public int getQuburcount() {
    return this._Quburcount;
  }
  
  public void setQuburcount(int i) {
    this._Quburcount = i;
  }
  
  public int getWeaponTotalDmg() {
    return this._WeaponTotalDmg;
  }
  
  public void setWeaponTotalDmg(int i) {
    this._WeaponTotalDmg = i;
  }
  
  public void addWeaponTotalDmg(int i) {
    this._WeaponTotalDmg += i;
  }
  
  public void setweaknss1(int i) {
    this._weaknss1 = i;
  }
  
  public int getweaknss1() {
    return this._weaknss1;
  }
  
  public void addweaknss1(int i) {
    this._weaknss += i;
  }
  
  public int getWeaponSkillPro() {
    return this._WeaponSkillPro;
  }
  
  public void setWeaponSkillPro(int i) {
    this._WeaponSkillPro = i;
  }
  
  public void addWeaponSkillPro(int i) {
    this._WeaponSkillPro += i;
  }
  
  public int getPcMagicPro() {
    return this._PcMagicPro;
  }
  
  public void setPcMagicPro(int i) {
    this._PcMagicPro = i;
  }
  
  public void addPcMagicPro(int i) {
    this._PcMagicPro += i;
  }
  
  public int getSave_Quest_Map1() {
    return this._Save_Quest_Map1;
  }
  
  public void setSave_Quest_Map1(int i) {
    this._Save_Quest_Map1 = i;
  }
  
  public int getSave_Quest_Map2() {
    return this._Save_Quest_Map2;
  }
  
  public void setSave_Quest_Map2(int i) {
    this._Save_Quest_Map2 = i;
  }
  
  public int getSave_Quest_Map3() {
    return this._Save_Quest_Map3;
  }
  
  public void setSave_Quest_Map3(int i) {
    this._Save_Quest_Map3 = i;
  }
  
  public int getSave_Quest_Map4() {
    return this._Save_Quest_Map4;
  }
  
  public void setSave_Quest_Map4(int i) {
    this._Save_Quest_Map4 = i;
  }
  
  public int getSave_Quest_Map5() {
    return this._Save_Quest_Map5;
  }
  
  public void setSave_Quest_Map5(int i) {
    this._Save_Quest_Map5 = i;
  }
  
  public void setCarId(int i) {
    this._CardId = i;
  }
  
  public int getCardId() {
    return this._CardId;
  }
  
  public Thread getTempThread() {
    return this._tempThread;
  }
  
  public void setTempThread(SoulTowerThread thread) {
    this._tempThread = (Thread)thread;
  }
  
  public boolean isSoulTower() {
    return (this.soulTower == 0);
  }
  
  public int getSoulTower() {
    return this.soulTower;
  }
  
  public void setSoulTower(int i) {
    this.soulTower = i;
  }
  
  public boolean petReceive(int itemObjectId) {
    if (!getMap().isTakePets()) {
      sendPackets((ServerBasePacket)new S_ServerMessage(563));
      return false;
    } 
    int petCost = 0;
    int petCount = 0;
    int divisor = 6;
    Object[] petList = getPetList().values().toArray();
    if (petList.length > ConfigOther.petcountchatype1) {
      sendPackets((ServerBasePacket)new S_ServerMessage(489));
      return false;
    } 
    Object[] array;
    int length = (array = petList).length;
    int i = 0;
    while (i < length) {
      Object pet = array[i];
      if (pet instanceof L1PetInstance && ((L1PetInstance)pet).getItemObjId() == itemObjectId)
        return false; 
      petCost += ((L1NpcInstance)pet).getPetcost();
      i++;
    } 
    int charisma = getCha();
    L1Pet l1pet = PetReading.get().getTemplate(itemObjectId);
    if (l1pet == null)
      return false; 
    int npcId = l1pet.get_npcid();
    charisma -= petCost;
    if (npcId == 45313 || npcId == 45710 || npcId == 45711 || npcId == 45712) {
      divisor = 12;
    } else {
      divisor = 2;
    } 
    petCount = charisma / divisor;
    if (petCount <= 0) {
      sendPackets((ServerBasePacket)new S_ServerMessage(489));
      return false;
    } 
    L1Npc npcTemp = NpcTable.get().getTemplate(npcId);
    L1PetInstance pet2 = new L1PetInstance(npcTemp, this, l1pet);
    pet2.setPetcost(divisor);
    return true;
  }
  
  public boolean petReceive1(int itemObjectId) {
    if (!getMap().isTakePets()) {
      sendPackets((ServerBasePacket)new S_ServerMessage(563));
      return false;
    } 
    int petCost = 0;
    int petCount = 0;
    int divisor = 6;
    Object[] petList = getPetList().values().toArray();
    if (petList.length > ConfigOther.petcountchatype) {
      sendPackets((ServerBasePacket)new S_ServerMessage(489));
      return false;
    } 
    Object[] array;
    int length = (array = petList).length;
    int i = 0;
    while (i < length) {
      Object pet = array[i];
      petCost += ((L1NpcInstance)pet).getPetcost();
      i++;
    } 
    int charisma = getCha();
    if (isCrown()) {
      charisma += 6;
    } else if (isElf()) {
      charisma += 12;
    } else if (isWizard()) {
      charisma += 6;
    } 
    L1Pet l1pet = PetReading.get().getTemplate(itemObjectId);
    if (l1pet == null)
      return false; 
    int npcId = l1pet.get_npcid();
    charisma -= petCost;
    if (npcId == 45313 || npcId == 45710 || npcId == 45711 || npcId == 45712) {
      divisor = 12;
    } else {
      divisor = 6;
    } 
    petCount = charisma / divisor;
    if (petCount <= 0) {
      sendPackets((ServerBasePacket)new S_ServerMessage(489));
      return false;
    } 
    L1Npc npcTemp = NpcTable.get().getTemplate(npcId);
    L1PetInstance pet2 = new L1PetInstance(npcTemp, this, l1pet);
    pet2.setPetcost(divisor);
    return true;
  }
  
  public boolean getarmor_setgive() {
    return this._isarmor_setgive;
  }
  
  public void setarmor_setgive(boolean flag) {
    this._isarmor_setgive = flag;
  }
  
  public String getSummon_npcid() {
    return this._Summon_npcid;
  }
  
  public void setSummon_npcid(String Summon_npcid) {
    this._Summon_npcid = Summon_npcid;
  }
  
  public void setsummon_skillid(int i) {
    this._summon_skillid = i;
  }
  
  public int getsummon_skillid() {
    return this._summon_skillid;
  }
  
  public void setsummon_skillidmp(int i) {
    this._summon_skillidmp = i;
  }
  
  public int getsummon_skillidmp() {
    return this._summon_skillidmp;
  }
  
  public boolean getchecksummid() {
    return this._checksummid;
  }
  
  public void setchecksummid(boolean flag) {
    this._checksummid = flag;
  }
  
  public boolean getchecksummidhp() {
    return this._checksummidhp;
  }
  
  public void setchecksummidhp(boolean flag) {
    this._checksummidhp = flag;
  }
  
  public boolean getmobatk() {
    return this._mobatk;
  }
  
  public void setmobatk(boolean flag) {
    this._mobatk = flag;
  }
  
  public int getTowerIsWhat() {
    return this._towerIsWhat;
  }
  
  public void setTowerIsWhat(int i) {
    this._towerIsWhat = i;
  }
  
  public int getAvatar() {
    return this._avatar;
  }
  
  public void setAvatar(int i) {
    this._avatar = i;
  }
  
  public boolean getIsTRIPLE_ARROW() {
    return this._TRIPLEARROW;
  }
  
  public void setIsTRIPLE_ARROW(boolean s) {
    this._TRIPLEARROW = s;
  }
  
  public int getAllCall_clan() {
    return this._AllCall_clan;
  }
  
  public void setAllCall_clan(int i) {
    this._AllCall_clan = i;
  }
  
  public int getzhufudianshu() {
    return this._zhufudianshu;
  }
  
  public void setzhufudianshu(int i) {
    this._zhufudianshu = i;
  }
  
  public int getyiwa() {
    return this._yiwa;
  }
  
  public void setyiwa(int i) {
    this._yiwa = i;
  }
  
  public int getyiwacishu() {
    return this._yiwacishu;
  }
  
  public void setyiwacishu(int i) {
    this._yiwacishu = i;
  }
  
  public double getyiwajilv1() {
    return this._yiwajilv1;
  }
  
  public void setyiwajilv1(double i) {
    this._yiwajilv1 = i;
  }
  
  public double getyiwajilv2() {
    return this._yiwajilv2;
  }
  
  public void setyiwajilv2(double i) {
    this._yiwajilv2 = i;
  }
  
  public double getyiwajilv3() {
    return this._yiwajilv3;
  }
  
  public void setyiwajilv3(double i) {
    this._yiwajilv3 = i;
  }
  
  public int getyiwajilvdj() {
    return this._yiwajilvdengji;
  }
  
  public void setyiwajilvdj(int i) {
    this._yiwajilvdengji = i;
  }
  
  public int getshaha() {
    return this._shaha;
  }
  
  public void setshaha(int i) {
    this._shaha = i;
  }
  
  public int getshahacishu() {
    return this._shahacishu;
  }
  
  public void setshahacishu(int i) {
    this._shahacishu = i;
  }
  
  public double getshahajilv1() {
    return this._shahajilv1;
  }
  
  public void setshahajilv1(double i) {
    this._shahajilv1 = i;
  }
  
  public double getshahajilv2() {
    return this._shahajilv2;
  }
  
  public void setshahajilv2(double i) {
    this._shahajilv2 = i;
  }
  
  public double getshahajilv3() {
    return this._shahajilv3;
  }
  
  public void setshahajilv3(double i) {
    this._shahajilv3 = i;
  }
  
  public int getshahajilvdj() {
    return this._shahajilvdengji;
  }
  
  public void setshahajilvdj(int i) {
    this._shahajilvdengji = i;
  }
  
  public int getmapule() {
    return this._mapule;
  }
  
  public void setmapule(int i) {
    this._mapule = i;
  }
  
  public int getmapulecishu() {
    return this._mapulecishu;
  }
  
  public void setmapulecishu(int i) {
    this._mapulecishu = i;
  }
  
  public double getmapulejilv1() {
    return this._mapulejilv1;
  }
  
  public void setmapulejilv1(double i) {
    this._mapulejilv1 = i;
  }
  
  public double getmapulejilv2() {
    return this._mapulejilv2;
  }
  
  public void setmapulejilv2(double i) {
    this._mapulejilv2 = i;
  }
  
  public double getmapulejilv3() {
    return this._mapulejilv3;
  }
  
  public void setmapulejilv3(double i) {
    this._mapulejilv3 = i;
  }
  
  public int getmapulejilvdj() {
    return this._mapulejilvdengji;
  }
  
  public void setmapulejilvdj(int i) {
    this._mapulejilvdengji = i;
  }
  
  public int getpageliao() {
    return this._pageliao;
  }
  
  public void setpageliao(int i) {
    this._pageliao = i;
  }
  
  public int getpageliaocishu() {
    return this._pageliaocishu;
  }
  
  public void setpageliaocishu(int i) {
    this._pageliaocishu = i;
  }
  
  public double getpageliaojilv1() {
    return this._pageliaojilv1;
  }
  
  public void setpageliaojilv1(double i) {
    this._pageliaojilv1 = i;
  }
  
  public double getpageliaojilv2() {
    return this._pageliaojilv2;
  }
  
  public void setpageliaojilv2(double i) {
    this._pageliaojilv2 = i;
  }
  
  public double getpageliaojilv3() {
    return this._pageliaojilv3;
  }
  
  public void setpageliaojilv3(double i) {
    this._pageliaojilv3 = i;
  }
  
  public int getpageliaojilvdj() {
    return this._pageliaojilvdengji;
  }
  
  public void setpageliaojilvdj(int i) {
    this._pageliaojilvdengji = i;
  }
  
  public int getgelanken() {
    return this._gelanken;
  }
  
  public void setgelanken(int i) {
    this._gelanken = i;
  }
  
  public int getgelankencishu() {
    return this._gelankencishu;
  }
  
  public void setgelankencishu(int i) {
    this._gelankencishu = i;
  }
  
  public double getgelankenjilv1() {
    return this._gelankenjilv1;
  }
  
  public void setgelankenjilv1(double i) {
    this._gelankenjilv1 = i;
  }
  
  public double getgelankenjilv2() {
    return this._gelankenjilv2;
  }
  
  public void setgelankenjilv2(double i) {
    this._gelankenjilv2 = i;
  }
  
  public double getgelankenjilv3() {
    return this._gelankenjilv3;
  }
  
  public void setgelankenjilv3(double i) {
    this._gelankenjilv3 = i;
  }
  
  public int getgelankenjilvdj() {
    return this._gelankenjilvdengji;
  }
  
  public void setgelankenjilvdj(int i) {
    this._gelankenjilvdengji = i;
  }
  
  
	public int getyinhaisa() {
		return this._yinhaisa;
	}

	public void setyinhaisa(int i) {
		this._yinhaisa = i;
	}

	public int getyinhaisacishu() {
		return this._yinhaisacishu;
	}

	public void setyinhaisacishu(int i) {
		this._yinhaisacishu = i;
	}

	public double getyinhaisajilv1() {
		return this._yinhaisajilv1;
	}

	public void setyinhaisajilv1(double i) {
		this._yinhaisajilv1 = i;
	}

	public double getyinhaisajilv2() {
		return this._yinhaisajilv2;
	}

	public void setyinhaisajilv2(double i) {
		this._yinhaisajilv2 = i;
	}

	public double getyinhaisajilv3() {
		return this._yinhaisajilv3;
	}

	public void setyinhaisajilv3(double i) {
		this._yinhaisajilv3 = i;
	}

	public int getyinhaisajilvdj() {
		return this._yinhaisajilvdengji;
	}

	public void setyinhaisajilvdj(int i) {
		this._yinhaisajilvdengji = i;
	}
  
  public void addExpRateToPc(int s) {
    if (s > 0) {
      this._expRateToPc = DoubleUtil.sum(this._expRateToPc, s / 100.0D);
    } else {
      this._expRateToPc = DoubleUtil.sub(this._expRateToPc, (s * -1) / 100.0D);
    } 
  }
  
  public double getExpRateToPc() {
    if (this._expRateToPc < 0.0D)
      return 0.0D; 
    return this._expRateToPc;
  }
  
  public Boolean getChatListenAlliance() {
    return this.chatListenAlliance;
  }
  
  public void setChatListenAlliance(Boolean chatListenAlliance) {
    this.chatListenAlliance = chatListenAlliance;
  }
  
  public Boolean getChatListenShout() {
    return this.chatListenShout;
  }
  
  public void setChatListenShout(Boolean chatListenShout) {
    this.chatListenShout = chatListenShout;
  }
  
  public Boolean getChatListenNormal() {
    return this.chatListenNormal;
  }
  
  public void setChatListenNormal(Boolean chatListenNormal) {
    this.chatListenNormal = chatListenNormal;
  }
  
  public Boolean getChatListenParty() {
    return this.chatListenParty;
  }
  
  public void setChatListenParty(Boolean chatListenParty) {
    this.chatListenParty = chatListenParty;
  }
  
  public Boolean getChatListenClan() {
    return this.chatListenClan;
  }
  
  public void setChatListenClan(Boolean chatListenClan) {
    this.chatListenClan = chatListenClan;
  }
  
  public Boolean getChatListenWhisper() {
    return this.chatListenWhisper;
  }
  
  public void setChatListenWhisper(Boolean chatListenWhisper) {
    this.chatListenWhisper = chatListenWhisper;
  }
  
  private class Death implements Runnable {
    private L1Character _lastAttacker;
    
    private Death(L1Character cha) {
      this._lastAttacker = cha;
    }
    
    public void run() {
      L1Character lastAttacker = this._lastAttacker;
      L1PcInstance targetpc = null;
      this._lastAttacker = null;
      L1PcInstance.this.setCurrentHp(0);
      L1PcInstance.this.setCurrentHp(0);
      L1PcInstance.this.setGresValid(false);
      while (L1PcInstance.this.isTeleport()) {
        try {
          Thread.sleep(300L);
        } catch (Exception exception) {}
      } 
      if (L1PcInstance.this.isInParty()) {
        Iterator<L1PcInstance> iterator = L1PcInstance.this.getParty().partyUsers().values().iterator();
        while (iterator.hasNext()) {
          L1PcInstance member = iterator.next();
          member.sendPackets((ServerBasePacket)new S_PacketBoxParty(L1PcInstance.this.getParty(), L1PcInstance.this));
        } 
      } 
      if (L1PcInstance.this.isActived()) {
        L1PcInstance enemy = null;
        if (lastAttacker instanceof L1PcInstance) {
          enemy = (L1PcInstance)lastAttacker;
          if (enemy != null)
            NewAutoPractice.get().AddAutoList(L1PcInstance.this, enemy); 
        } 
        L1PcInstance.this.setActived(false);
      } 
      L1PcInstance.this.set_delete_time(180);
      if (L1PcInstance.this.getnpcdmg() > 0.0D) {
        L1PcInstance.this.sendPackets((ServerBasePacket)new S_SystemMessage("\\fU因您死亡,攻击伤害累积重新计算"));
        L1PcInstance.this.setnpcdmg(0.0D);
        L1PcInstance.this.setnpciddmg(0);
      } 
      if (!L1PcInstance.this.getPetList().isEmpty()) {
        Object[] array;
        int n = (array = L1PcInstance.this.getPetList().values().toArray()).length;
        int i = 0;
        while (i < n) {
          Object petList = array[i];
          if (petList instanceof L1SummonInstance) {
            L1SummonInstance summon = (L1SummonInstance)petList;
            if (summon != null) {
              if (summon.destroyed())
                return; 
              summon.Death((L1Character)null);
            } 
          } 
          i++;
        } 
      } 
      if (!L1PcInstance.this.getDolls().isEmpty()) {
        Object[] array;
        int n = (array = L1PcInstance.this.getDolls().values().toArray()).length;
        int i = 0;
        while (i < n) {
          Object obj = array[i];
          L1DollInstance doll = (L1DollInstance)obj;
          doll.deleteDoll();
          i++;
        } 
      } 
      if (L1PcInstance.this.getHierarchs() != null)
        L1PcInstance.this.getHierarchs().deleteHierarch(); 
      L1PcInstance.this.stopHpRegeneration();
      L1PcInstance.this.stopMpRegeneration();
      L1PcInstance.this.getMap().setPassable((Point)L1PcInstance.this.getLocation(), true);
      int tempchargfx = 0;
      if (L1PcInstance.this.hasSkillEffect(67)) {
        tempchargfx = L1PcInstance.this.getTempCharGfx();
        L1PcInstance.this.setTempCharGfxAtDead(tempchargfx);
      } else {
        L1PcInstance.this.setTempCharGfxAtDead(L1PcInstance.this.getClassId());
      } 
      L1SkillUse l1skilluse = new L1SkillUse();
      l1skilluse.handleCommands(L1PcInstance.this, 44, L1PcInstance.this.getId(), L1PcInstance.this.getX(), 
          L1PcInstance.this.getY(), 0, 1);
      if (tempchargfx != 0) {
        L1PcInstance.this.sendPacketsAll((ServerBasePacket)new S_ChangeShape(L1PcInstance.this, tempchargfx));
      } else {
        try {
          Thread.sleep(1000L);
        } catch (Exception exception) {}
      } 
      L1PcInstance.this.sendPacketsAll((ServerBasePacket)new S_DoActionGFX(L1PcInstance.this.getId(), 8));
      L1EffectInstance tomb = L1SpawnUtil.spawnEffect(86126, 300, L1PcInstance.this.getX(), 
          L1PcInstance.this.getY(), L1PcInstance.this.getMapId(), L1PcInstance.this, 0);
      L1PcInstance.this.set_tomb(tomb);
      boolean isSafetyZone = false;
      boolean isCombatZone = false;
      boolean isWar = false;
      if (L1PcInstance.this.isSafetyZone())
        isSafetyZone = true; 
      if (L1PcInstance.this.isCombatZone())
        isCombatZone = true; 
      if (lastAttacker instanceof L1GuardInstance) {
        if (L1PcInstance.this.get_PKcount() > 0)
          L1PcInstance.this.set_PKcount(L1PcInstance.this.get_PKcount() - 1); 
        L1PcInstance.this.setLastPk((Timestamp)null);
      } 
      if (lastAttacker instanceof L1GuardianInstance) {
        if (L1PcInstance.this.getPkCountForElf() > 0)
          L1PcInstance.this.setPkCountForElf(L1PcInstance.this.getPkCountForElf() - 1); 
        L1PcInstance.this.setLastPkForElf((Timestamp)null);
      } 
      L1PcInstance fightPc = null;
      if (lastAttacker instanceof L1PcInstance) {
        fightPc = (L1PcInstance)lastAttacker;
      } else if (lastAttacker instanceof L1PetInstance) {
        L1PetInstance npc = (L1PetInstance)lastAttacker;
        if (npc.getMaster() != null)
          fightPc = (L1PcInstance)npc.getMaster(); 
      } else if (lastAttacker instanceof L1SummonInstance) {
        L1SummonInstance npc2 = (L1SummonInstance)lastAttacker;
        if (npc2.getMaster() != null)
          fightPc = (L1PcInstance)npc2.getMaster(); 
      } else if (lastAttacker instanceof L1IllusoryInstance) {
        L1IllusoryInstance npc3 = (L1IllusoryInstance)lastAttacker;
        if (npc3.getMaster() != null)
          fightPc = (L1PcInstance)npc3.getMaster(); 
      } else if (lastAttacker instanceof L1EffectInstance) {
        L1EffectInstance npc4 = (L1EffectInstance)lastAttacker;
        if (npc4.getMaster() != null)
          fightPc = (L1PcInstance)npc4.getMaster(); 
      } 
      if (fightPc != null) {
        if (L1PcInstance.this.getFightId() == fightPc.getId() && 
          fightPc.getFightId() == L1PcInstance.this.getId()) {
          L1PcInstance.this.setFightId(0);
          L1PcInstance.this.sendPackets((ServerBasePacket)new S_PacketBox(5, 0, 0));
          fightPc.setFightId(0);
          fightPc.sendPackets((ServerBasePacket)new S_PacketBox(5, 0, 0));
          return;
        } 
        if (L1PcInstance.this.isEncounter() && fightPc.getLevel() > L1PcInstance.this.getLevel() && 
          fightPc.getLevel() - L1PcInstance.this.getLevel() >= 10)
          return; 
        if (L1PcInstance.this.castleWarResult())
          isWar = true; 
        if (L1PcInstance.this.simWarResult(lastAttacker))
          isWar = true; 
        if (L1PcInstance.this.isInWarAreaAndWarTime(L1PcInstance.this, fightPc))
          isWar = true; 
        NewAutoPractice.get().AddAutoList(L1PcInstance.this, fightPc);
        if (L1PcInstance.this.getLevel() >= ConfigOther.killlevel) {
          boolean isShow = false;
          if (isWar) {
            isShow = true;
          } else if (!isCombatZone) {
            isShow = true;
          } 
          if (isShow && !L1PcInstance.this.isGm()) {
            if (fightPc.getWeapon() != null) {
              ConfigKill.get().msg(L1PcInstance.this.getName(), fightPc.getName(), 
                  fightPc.getWeapon().getViewName());
            } else {
              ConfigKill.get().msgnoweapon(fightPc.getName(), L1PcInstance.this.getName(), "空手");
            } 
            RecordTable.get().killpc(fightPc.getName(), L1PcInstance.this.getName());
          } 
        } 
        fightPc.get_other().add_killCount(1);
        L1PcInstance.this.get_other().add_deathCount(1);
      } 
      if (isSafetyZone && !(lastAttacker instanceof L1MonsterInstance))
        return; 
      if (isCombatZone && !(lastAttacker instanceof L1MonsterInstance))
        return; 
      if (!L1PcInstance.this.getMap().isEnabledDeathPenalty())
        return; 
      boolean castle_area = L1CastleLocation.checkInAllWarArea(L1PcInstance.this.getX(), 
          L1PcInstance.this.getY(), L1PcInstance.this.getMapId());
      if (L1PcInstance.this.castleWarResult() && !ConfigAlt.ALT_WARPUNISHMENT)
        return; 
      c1TypeRate(fightPc);
      expRate(fightPc);
      if (fightPc != null)
        if (fightPc.getLawful() >= 0) {
          fightPc.setLawful(-15000);
          fightPc.sendPacketsAll((ServerBasePacket)new S_Lawful(fightPc));
        } else {
          fightPc.addLawful(-1000);
          fightPc.sendPacketsAll((ServerBasePacket)new S_Lawful(fightPc));
        }  
      if (L1PcInstance.this.getLawful() < 32767) {
        if (L1PcInstance.this.castleWarResult() && castle_area)
          return; 
        if (!L1PcInstance.this.isProtector() || ProtectorSet.DEATH_VALUE_ITEM) {
          lostRate(1);
          lostSkillRate(1);
        } 
      } 
      if (taketreasure.START && fightPc != null)
        L1PcInstance.this.checkItemSteal(fightPc); 
      if (fightPc != null) {
        if (isWar)
          return; 
        if (fightPc.getClan() != null && L1PcInstance.this.getClan() != null && WorldWar.get()
          .isWar(fightPc.getClan().getClanName(), L1PcInstance.this.getClan().getClanName()))
          return; 
        if (fightPc.isSafetyZone())
          return; 
        if (fightPc.isCombatZone())
          return; 
        if (L1PcInstance.this.getLawful() >= 0 && !L1PcInstance.this.hasSkillEffect(5122)) {
          boolean isChangePkCount = false;
          if (fightPc.getLawful() < 30000) {
            fightPc.set_PKcount(fightPc.get_PKcount() + 1);
            isChangePkCount = true;
            if (fightPc.isElf() && L1PcInstance.this.isElf())
              fightPc.setPkCountForElf(fightPc.getPkCountForElf() + 1); 
          } 
          fightPc.setLastPk();
          if (fightPc.getLawful() == 32767)
            fightPc.setLastPk((Timestamp)null); 
          if (fightPc.isElf() && L1PcInstance.this.isElf())
            fightPc.setLastPkForElf(); 
          if (ConfigAlt.ALT_PUNISHMENT)
            if (isChangePkCount && fightPc.get_PKcount() >= 1 && fightPc.get_PKcount() < 1000) {
              fightPc.sendPackets((ServerBasePacket)new S_BlueMessage(551, String.valueOf(fightPc.get_PKcount()), "1000"));
            } else if (isChangePkCount && fightPc.get_PKcount() >= 1000) {
              fightPc.beginHell(true);
            }  
        } else {
          L1PcInstance.this.setPinkName(false);
        } 
      } 
    }
    
    private void c1TypeRate(L1Character lastAttacker) {
      L1PcInstance attacker = null;
      if (L1PcInstance.this.getPrestigeLv() > 0) {
        L1PcInstance.this.addPrestige(-ConfigOther.dead_score);
        if (L1PcInstance.this.getPrestigeLv() <= 0)
          L1PcInstance.this.setPrestige(0); 
      } 
      if (CampSet.CAMPSTART && L1PcInstance.this._c_power != null && L1PcInstance.this._c_power.get_c1_type() != 0 && 
        L1PcInstance.this._c_power.get_c1_type() != 0) {
        L1ItemInstance item1 = L1PcInstance.this.getInventory().checkItemX(44165, 1L);
        if (item1 != null) {
          L1PcInstance.this.getInventory().removeItem(item1, 1L);
          L1PcInstance.this.sendPackets((ServerBasePacket)new S_ServerMessage("\\fU你身上带有" + item1.getName() + ",阵营积分受到守护!"));
          return;
        } 
        L1Name_Power power = L1PcInstance.this._c_power.get_power();
        int score = L1PcInstance.this._other.get_score() - power.get_down();
        if (score > 0) {
          L1PcInstance.this._other.set_score(score);
          L1PcInstance.this.sendPackets((ServerBasePacket)new S_ServerMessage(
                String.valueOf(String.valueOf(L1WilliamSystemMessage.ShowMessage(8))) + power.get_down()));
          if (score < 0)
            L1PcInstance.this._other.set_score(0); 
          if (power.get_getscore() > 0 && lastAttacker instanceof L1PcInstance) {
            attacker = (L1PcInstance)lastAttacker;
            if (attacker._other.get_score() > 0) {
              attacker._other.set_score(attacker._other.get_score() + power.get_getscore());
              if (attacker._other.get_score() < 0)
                attacker._other.set_score(0); 
              L1PcInstance.this.sendPackets((ServerBasePacket)new S_ServerMessage("\\fU您被抢夺阵营积分:" + power.get_getscore()));
              attacker.sendPackets((ServerBasePacket)new S_ServerMessage("\\fU您抢夺阵营积分获得:" + power.get_getscore()));
            } 
          } 
        } else {
          L1PcInstance.this._other.set_score(0);
          L1PcInstance.this.sendPackets((ServerBasePacket)new S_ServerMessage(L1WilliamSystemMessage.ShowMessage(9)));
        } 
        int lv = C1_Name_Type_Table.get().getLv(L1PcInstance.this._c_power.get_c1_type(), 
            L1PcInstance.this._other.get_score());
        if (lv != L1PcInstance.this._c_power.get_power().get_c1_id()) {
          L1PcInstance.this._c_power.set_power(L1PcInstance.this, false);
          L1PcInstance.this.sendPackets((ServerBasePacket)new S_ServerMessage(
                "\\fR阶级变更:" + L1PcInstance.this._c_power.get_power().get_c1_name_type()));
          L1PcInstance.this.sendPacketsAll((ServerBasePacket)new S_ChangeName(L1PcInstance.this, true));
        } 
      } 
    }
    
    private void expRate(L1PcInstance fightPc) {
      if (L1PcInstance.this.isProtector() && !ProtectorSet.DEATH_VALUE_EXP)
        return; 
      if (L1PcInstance.this._isCraftsmanHeirloom())
        return; 
      L1ItemInstance item1 = L1PcInstance.this.getInventory().checkItemX2(44164, 1L);
      if (item1 != null) {
        L1PcInstance.this.getInventory().removeItem(item1, 1L);
        ItemVIPTable.get().deleItemVIP(L1PcInstance.this, 44164);
        L1ItemInstance steal_item = L1PcInstance.this.getInventory().findItemId(ConfigOther.Lost_Item);
        L1Item steal_item_msg = ItemTable.get().getTemplate(ConfigOther.Lost_Item);
        if (ConfigOther.LostItem_ON == 1)
          if (steal_item != null) {
            long count = ThreadLocalRandom.current().nextInt(ConfigOther.Lost_Count_1, ConfigOther.Lost_Count_2) + 1L;
            count = (steal_item.getCount() >= count) ? count : steal_item.getCount();
            L1PcInstance.this.getInventory().tradeItem(steal_item, count, (L1Inventory)fightPc.getInventory());
            fightPc.sendPackets((ServerBasePacket)new S_ServerMessage("\\aD对方死亡!并发现对方装备特殊道具"));
            fightPc.sendPackets((ServerBasePacket)new S_ServerMessage("获得" + steal_item_msg + "：" + count));
          } else {
            L1Item steal_item_name = ItemTable.get().getTemplate(ConfigOther.Lost_Item);
            steal_item_name.getName();
            fightPc.sendPackets((ServerBasePacket)new S_ServerMessage("\\aD对方死亡!并发现对方装备特殊道具"));
            fightPc.sendPackets((ServerBasePacket)new S_ServerMessage("\\aD可恶!对方身上没有【" + steal_item_name.getName() + "】可以抢夺"));
          }  
        if (ConfigOther.LostItem2_ON == 1) {
          long count2 = ThreadLocalRandom.current().nextInt(ConfigOther.Lost_Count2_1, ConfigOther.Lost_Count2_2) + 1L;
          L1ItemInstance _item2 = ItemTable.get().createItem(ConfigOther.Lost_Item2);
          L1Item _item2_msg = ItemTable.get().getTemplate(ConfigOther.Lost_Item2);
          _item2_msg.getName();
          if (fightPc != null && _item2 != null) {
            _item2.setCount(count2);
            fightPc.getInventory().storeItem(_item2);
            fightPc.sendPackets((ServerBasePacket)new S_ServerMessage("\\aD恭喜杀死【" + L1PcInstance.this.getName() + "】" + "获得" + "【" + _item2_msg.getName() + "】"));
            fightPc.sendPackets((ServerBasePacket)new S_ServerMessage(403, _item2.getLogName()));
            fightPc.saveInventory();
          } 
        } 
        if (ConfigOther.ExpRateLost == 1) {
          L1PcInstance.this.sendPackets((ServerBasePacket)new S_ServerMessage("\\fU" + item1.getName() + "的关系,因此经验受到保护。"));
          return;
        } 
      } 
      if (L1PcInstance.this._vip_2) {
        L1PcInstance.this.sendPackets((ServerBasePacket)new S_ServerMessage("受到经验加值卡的保护,死亡不损失经验。"));
        return;
      } 
      if (L1PcInstance.this.hasSkillEffect(8000) && L1PcInstance.this.getMapId() == 537) {
        L1PcInstance.this.killSkillEffectTimer(8000);
        L1PcInstance.this.sendPackets((ServerBasePacket)new S_ServerMessage("\\fU受到祝福之光的保护,刚刚死掉没有掉%。"));
        return;
      } 
      if (L1WilliamGfxIdOrginal.DeadExp(L1PcInstance.this.getTempCharGfx())) {
        L1PcInstance.this.setExpRes(1);
        return;
      } 
      if (L1WilliamGfxIdOrginalpoly.DeadExp(L1PcInstance.this.getTempCharGfx())) {
        L1PcInstance.this.setExpRes(1);
        return;
      } 
      L1PcInstance.this.deathPenalty();
      L1PcInstance.this.setGresValid(true);
      if (L1PcInstance.this.getExpRes() == 0)
        L1PcInstance.this.setExpRes(1); 
    }
    
    private void lostRate(int mode) {
      if (L1PcInstance.this._isCraftsmanHeirloom())
        return; 
      if (L1PcInstance.this.getMap().isdropitem()) {
        L1PcInstance.this.sendPackets((ServerBasePacket)new S_ServerMessage("\\fU此地图死亡不会喷出物品。"));
        return;
      } 
      L1ItemInstance item1 = L1PcInstance.this.getInventory().checkItemX(44163, 1L);
      if (item1 != null) {
        L1PcInstance.this.getInventory().removeItem(item1, 1L);
        L1PcInstance.this.sendPackets((ServerBasePacket)new S_ServerMessage("\\fU" + item1.getName() + "的关系,因此装备受到保护。"));
        return;
      } 
      if (L1PcInstance.this.isProtector() && ProtectorSet.DEATH_VALUE_ITEM) {
        L1ItemInstance item2 = L1PcInstance.this.getInventory().findItemId(ProtectorSet.ITEM_ID);
        if (item2 != null) {
          item2.set_showId(L1PcInstance.this.get_showId());
          int x = L1PcInstance.this.getX();
          int y = L1PcInstance.this.getY();
          short m = L1PcInstance.this.getMapId();
          L1PcInstance.this.getInventory().tradeItem(item2, item2.isStackable() ? item2.getCount() : 1L, 
              (L1Inventory)World.get().getInventory(x, y, m));
        } 
        L1PcInstance.this.sendPackets((ServerBasePacket)new S_ServerMessage(638, item2.getLogName()));
        return;
      } 
      int lostRate = (int)(((L1PcInstance.this.getLawful() + 32768.0D) / 1000.0D - 65.0D) * 4.0D);
      if (lostRate < 0) {
        int lawful2, rnd, count, lawful;
        lostRate *= -1;
        if (L1PcInstance.this.getLawful() < 0)
          lostRate = 1000; 
        switch (mode) {
          case 1:
            lawful2 = L1PcInstance.this.getLawful();
            rnd = L1PcInstance._random.nextInt(100) + 1;
            if (lawful2 > -ConfigOther.Lost_Item_high && lawful2 <= -ConfigOther.Lost_Item_Low && 
              rnd <= ConfigOther.Lost_Item_Rnd && 
              ConfigOther.Lost_Item_Count > 0) {
              int c = L1PcInstance._random.nextInt(ConfigOther.Lost_Item_Count) + 1;
              L1PcInstance.this.caoPenaltyResult(c);
            } 
            if (lawful2 > -ConfigOther.Lost_Item_high_2 && lawful2 <= -ConfigOther.Lost_Item_Low_2 && 
              rnd <= ConfigOther.Lost_Item_Rnd_2 && 
              ConfigOther.Lost_Item_Count_2 > 0) {
              int c = L1PcInstance._random.nextInt(ConfigOther.Lost_Item_Count_2) + 1;
              L1PcInstance.this.caoPenaltyResult(c);
            } 
            if (lawful2 > -ConfigOther.Lost_Item_high_3 && lawful2 <= -ConfigOther.Lost_Item_Low_3 && 
              rnd <= ConfigOther.Lost_Item_Rnd_3 && 
              ConfigOther.Lost_Item_Count_3 > 0) {
              int c = L1PcInstance._random.nextInt(ConfigOther.Lost_Item_Count_3) + 1;
              L1PcInstance.this.caoPenaltyResult(c);
            } 
            if (lawful2 > -ConfigOther.Lost_Item_high_4 && lawful2 <= -ConfigOther.Lost_Item_Low_4 && 
              rnd <= ConfigOther.Lost_Item_Rnd_4 && 
              ConfigOther.Lost_Item_Count_4 > 0) {
              int c = L1PcInstance._random.nextInt(ConfigOther.Lost_Item_Count_4) + 1;
              L1PcInstance.this.caoPenaltyResult(c);
            } 
            if (lawful2 > ConfigOther.Lost_Item_high_5 && lawful2 < ConfigOther.Lost_Item_Low_5 && 
              rnd <= ConfigOther.Lost_Item_Rnd_5 && 
              ConfigOther.Lost_Item_Count_5 > 0) {
              int c = L1PcInstance._random.nextInt(ConfigOther.Lost_Item_Count_5) + 1;
              L1PcInstance.this.caoPenaltyResult(c);
            } 
            if (lawful2 > ConfigOther.Lost_Item_high_6 && lawful2 < ConfigOther.Lost_Item_Low_6 && 
              rnd <= ConfigOther.Lost_Item_Rnd_6 && 
              ConfigOther.Lost_Item_Count_6 > 0) {
              int c = L1PcInstance._random.nextInt(ConfigOther.Lost_Item_Count_6) + 1;
              L1PcInstance.this.caoPenaltyResult(c);
            } 
            if (lawful2 > ConfigOther.Lost_Item_high_7 && lawful2 < ConfigOther.Lost_Item_Low_7 && 
              rnd <= ConfigOther.Lost_Item_Rnd_7 && 
              ConfigOther.Lost_Item_Count_7 > 0) {
              int c = L1PcInstance._random.nextInt(ConfigOther.Lost_Item_Count_7) + 1;
              L1PcInstance.this.caoPenaltyResult(c);
            } 
            if (lawful2 > ConfigOther.Lost_Item_high_8 && lawful2 < ConfigOther.Lost_Item_Low_8 && 
              rnd <= ConfigOther.Lost_Item_Rnd_8 && 
              ConfigOther.Lost_Item_Count_8 > 0) {
              int c = L1PcInstance._random.nextInt(ConfigOther.Lost_Item_Count_8) + 1;
              L1PcInstance.this.caoPenaltyResult(c);
            } 
            break;
          case 2:
            count = 0;
            lawful = L1PcInstance.this.getLawful();
            if (lawful >= -32768 && lawful <= -30000) {
              count = L1PcInstance._random.nextInt(4) + 1;
            } else if (lawful > -30000 && lawful <= -20000) {
              count = L1PcInstance._random.nextInt(3) + 1;
            } else if (lawful > -20000 && lawful <= -10000) {
              count = L1PcInstance._random.nextInt(2) + 1;
            } else if (lawful > -10000 && lawful <= 32767) {
              count = L1PcInstance._random.nextInt(1) + 1;
            } 
            if (count > 0)
              L1PcInstance.this.caoPenaltyResult(count); 
            break;
        } 
      } 
    }
    
    private void lostSkillRate(int mode) {
      int skillCount = L1PcInstance.this._skillList.size();
      if (skillCount > 0) {
        int lawful3, rnd, count = 0;
        int lawful = L1PcInstance.this.getLawful();
        switch (mode) {
          case 1:
            lawful3 = L1PcInstance.this.getLawful();
            rnd = L1PcInstance._random.nextInt(100) + 1;
            if (lawful3 > -ConfigOther.Lost_Skill_high && lawful3 <= -ConfigOther.Lost_Skill_Low && 
              rnd <= ConfigOther.Lost_Skill_Rnd && 
              ConfigOther.Lost_Skill_Count > 0) {
              int c = L1PcInstance._random.nextInt(ConfigOther.Lost_Skill_Count) + 1;
              L1PcInstance.this.delSkill(c);
            } 
            if (lawful3 > -ConfigOther.Lost_Skill_high_2 && lawful3 <= -ConfigOther.Lost_Skill_Low_2 && 
              rnd <= ConfigOther.Lost_Skill_Rnd_2 && 
              ConfigOther.Lost_Skill_Count_2 > 0) {
              int c = L1PcInstance._random.nextInt(ConfigOther.Lost_Skill_Count_2) + 1;
              L1PcInstance.this.delSkill(c);
            } 
            if (lawful3 > -ConfigOther.Lost_Skill_high_3 && lawful3 <= -ConfigOther.Lost_Skill_Low_3 && 
              rnd <= ConfigOther.Lost_Skill_Rnd_3 && 
              ConfigOther.Lost_Skill_Count_3 > 0) {
              int c = L1PcInstance._random.nextInt(ConfigOther.Lost_Skill_Count_3) + 1;
              L1PcInstance.this.delSkill(c);
            } 
            if (lawful3 > -ConfigOther.Lost_Skill_high_4 && lawful3 <= -ConfigOther.Lost_Skill_Low_4 && 
              rnd <= ConfigOther.Lost_Skill_Rnd_4 && 
              ConfigOther.Lost_Skill_Count_4 > 0) {
              int c = L1PcInstance._random.nextInt(ConfigOther.Lost_Skill_Count_4) + 1;
              L1PcInstance.this.delSkill(c);
            } 
            if (lawful3 > ConfigOther.Lost_Skill_high_5 && lawful3 <= ConfigOther.Lost_Skill_Low_5 && 
              rnd <= ConfigOther.Lost_Skill_Rnd_5 && 
              ConfigOther.Lost_Skill_Count_5 > 0) {
              int c = L1PcInstance._random.nextInt(ConfigOther.Lost_Skill_Count_5) + 1;
              L1PcInstance.this.delSkill(c);
            } 
            if (lawful3 > ConfigOther.Lost_Skill_high_6 && lawful3 <= ConfigOther.Lost_Skill_Low_6 && 
              rnd <= ConfigOther.Lost_Skill_Rnd_6 && 
              ConfigOther.Lost_Skill_Count_6 > 0) {
              int c = L1PcInstance._random.nextInt(ConfigOther.Lost_Skill_Count_6) + 1;
              L1PcInstance.this.delSkill(c);
            } 
            if (lawful3 > ConfigOther.Lost_Skill_high_7 && lawful3 <= ConfigOther.Lost_Skill_Low_7 && 
              rnd <= ConfigOther.Lost_Skill_Rnd_7 && 
              ConfigOther.Lost_Skill_Count_7 > 0) {
              int c = L1PcInstance._random.nextInt(ConfigOther.Lost_Skill_Count_7) + 1;
              L1PcInstance.this.delSkill(c);
            } 
            if (lawful3 > ConfigOther.Lost_Skill_high_8 && lawful3 <= ConfigOther.Lost_Skill_Low_8 && 
              rnd <= ConfigOther.Lost_Skill_Rnd_8 && 
              ConfigOther.Lost_Skill_Count_8 > 0) {
              int c = L1PcInstance._random.nextInt(ConfigOther.Lost_Skill_Count_8) + 1;
              L1PcInstance.this.delSkill(c);
            } 
            break;
          case 2:
            if (lawful < 0 && lawful >= -32767)
              count = 1 + L1PcInstance._random.nextInt(3); 
            if (lawful == -32768)
              count = 4; 
            if (count > 0)
              L1PcInstance.this.delSkill(count); 
            break;
        } 
      } 
    }
  }
  
  public void endAuto() {
    setActived(false);
    Random random = new Random();
    int nx = 33448 + random.nextInt(3);
    int ny = 32793 + random.nextInt(3);
    L1Teleport.teleport(this, nx, ny, (short)4, 5, true);
    sendPackets((ServerBasePacket)new S_SystemMessage("挂机时间不足故无法挂机"));
    try {
      save();
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
    } 
  }
  
  public void set_allclanbid(boolean allclanbid) {
    this._allclanbid = allclanbid;
  }
  
  public boolean is_allclanbid() {
    return this._allclanbid;
  }
  
  public L1PcInstance() {
    this._backpage = 1;
    this._skins = new HashMap<>();
    this._isKill = false;
    this._attackenemy = new ArrayList<>();
    this._Badattackenemy = new ArrayList<>();
    this._hpr = 0;
    this._trueHpr = 0;
    this._mpr = 0;
    this._trueMpr = 0;
    this._originalHpr = 0;
    this._originalMpr = 0;
    this._hpRegenType = 0;
    this._hpRegenState = 4;
    this._mpRegenType = 0;
    this._mpRegenState = 4;
    this._awakeMprTime = 0;
    this._awakeSkillId = 0;
    this._jl1 = false;
    this._jl2 = false;
    this._jl3 = false;
    this._el1 = false;
    this._el2 = false;
    this._el3 = false;
    this._isCHAOTIC = false;
    this._skillList = new ArrayList<>();
    this._classFeature = null;
    this._sellList = new ArrayList<>();
    this._buyList = new ArrayList<>();
    this._isPrivateShop = false;
    this._isTradingInPrivateShop = false;
    this._partnersPrivateShopItemCount = 0;
    this._oldTime = 0L;
    this._originalEr = 0;
    this._netConnection = null;
    this._karma = new L1Karma();
    this._isTeleport = false;
    this._isDrink = false;
    this._isGres = false;
    this._baseMaxHp = 0;
    this._baseMaxMp = 0;
    this._baseAc = 0;
    this._originalAc = 0;
    this._baseStr = 0;
    this._baseCon = 0;
    this._baseDex = 0;
    this._baseCha = 0;
    this._baseInt = 0;
    this._baseWis = 0;
    this._originalStr = 0;
    this._originalCon = 0;
    this._originalDex = 0;
    this._originalCha = 0;
    this._originalInt = 0;
    this._originalWis = 0;
    this._originalDmgup = 0;
    this._originalBowDmgup = 0;
    this._originalHitup = 0;
    this._originalBowHitup = 0;
    this._originalMr = 0;
    this._originalMagicHit = 0;
    this._originalMagicCritical = 0;
    this._originalMagicConsumeReduction = 0;
    this._originalMagicDamage = 0;
    this._originalHpup = 0;
    this._originalMpup = 0;
    this._baseDmgup = 0;
    this._baseBowDmgup = 0;
    this._baseHitup = 0;
    this._baseBowHitup = 0;
    this._baseMr = 0;
    this.invisDelayCounter = 0;
    this._invisTimerMonitor = new Object();
    this._ghost = false;
    this._ghostTime = -1;
    this._ghostCanTalk = true;
    this._isReserveGhost = false;
    this._ghostSaveLocX = 0;
    this._ghostSaveLocY = 0;
    this._ghostSaveMapId = 0;
    this._ghostSaveHeading = 0;
    this._weightUP = 1.0D;
    this._weightReduction = 0;
    this._originalStrWeightReduction = 0;
    this._originalConWeightReduction = 0;
    this._hasteItemEquipped = 0;
    this._damageReductionByArmor = 0;
    this._hitModifierByArmor = 0;
    this._dmgModifierByArmor = 0;
    this._bowHitModifierByArmor = 0;
    this._bowDmgModifierByArmor = 0;
    this._isFishing = false;
    this._fishX = -1;
    this._fishY = -1;
    this._cookingId = 0;
    this._dessertId = 0;
    this._excludingList = new L1ExcludingList();
    this._teleportX = 0;
    this._teleportY = 0;
    this._teleportMapId = 0;
    this._teleportHeading = 0;
    this._isCanWhisper = true;
    this._isShowTradeChat = true;
    this._isShowWorldChat = true;
    this._chatCount = 0;
    this._oldChatTimeInMillis = 0L;
    this._isInCharReset = false;
    this._tempLevel = 1;
    this._tempMaxLevel = 1;
    this._isSummonMonster = false;
    this._isShapeChange = false;
    this._textByte = null;
    this._outChat = null;
    this._mazu = false;
    this._mazu_time = 0L;
    this._expadd = 0.0D;
    this._isFoeSlayer = false;
    this._actionId = -1;
    this._allpowers = new ConcurrentHashMap<>();
    this._magic_modifier_dmg = 0;
    this._magic_reduction_dmg = 0;
    this._rname = false;
    this._retitle = false;
    this._repass = 0;
    this._trade_items = new ArrayList<>();
    this._mode_id = 0;
    this._check_item = false;
    this._vip_1 = false;
    this._vip_2 = false;
    this._vip_3 = false;
    this._vip_4 = false;
    this._global_time = 0L;
    this._doll_hpr = 0;
    this._doll_hpr_time = 0;
    this._doll_hpr_time_src = 0;
    this._doll_mpr = 0;
    this._doll_mpr_time = 0;
    this._doll_mpr_time_src = 0;
    this._doll_get = new int[2];
    this._doll_get_time = 0;
    this._doll_get_time_src = 0;
    this._spr_move_time = 0L;
    this._spr_attack_time = 0L;
    this._spr_skill_time = 0L;
    this._delete_time = 0;
    this._up_hp_potion = 0;
    this._venom_resist = 0;
    this._speed = null;
    this._arena = 0;
    this._temp_adena = 0;
    this._ss_time = 0L;
    this._ss = 0;
    this._elitePlateMail_Fafurion = 0;
    this._fafurion_hpmin = 0;
    this._fafurion_hpmax = 0;
    this._SummonId = 0;
    this._lap = 1;
    this._lapCheck = 0;
    this._order_list = false;
    this._state = 0;
    this._target = null;
    this._InviteList = new ArrayList<>();
    this._cmalist = new ArrayList<>();
    this._isATeam = false;
    this._isBTeam = false;
    this._acceleratorChecker = new AcceleratorChecker(this);
    this._Slot = 0;
    this._itempoly = false;
    this._itempoly1 = false;
    this._stunlevel = 0;
    this._other_ReductionDmg = 0;
    this._Clan_ReductionDmg = 0;
    this._Clanmagic_reduction_dmg = 0;
    this._addExpByArmor = 0.0D;
    this._PcContribution = 0;
    this._clanContribution = 0;
    this._clanadena = 0;
    this._checkgm = false;
    this.check_lv = false;
    this._EsotericSkill = 0;
    this._EsotericCount = 0;
    this._isEsoteric = false;
    this._TripleArrow = false;
    this._checklogpc = false;
    this._savepclog = 0;
    this._ReductionDmg = 0;
    this._pcdmg = 0;
    this._paycount = 0;
    this._ArmorCount1 = 0;
    this._logintime = 0;
    this._logintime1 = 0;
    this._PartyExp = 0.0D;
    this.ATK_ai = false;
    this._dolldamageReductionByArmor = 0;
    this._reduction_dmg = 0;
    this._isTeleportToOk = false;
    this._MOVE_STOP = false;
    this._amount = 0;
    this._consume_point = 0L;
    this._tempStr = 0;
    this._tempDex = 0;
    this._tempCon = 0;
    this._tempWis = 0;
    this._tempCha = 0;
    this._tempInt = 0;
    this._tempInitPoint = 0;
    this._tempElixirstats = 0;
    this.weapondmg = 0;
    this._reward_Weapon = new int[9];
    this.elfweapon = 0;
    this._PVPdmg = 0;
    this._PVPdmgReduction = 0;
    this._attr_potion_heal = 0;
    this._penetrate = 0;
    this._attr_物理格档 = 0;
    this._attr_魔法格档 = 0;
    this._addStunLevel = 0;
    this._loginpoly = 0;
    this._isAI = false;
    this._ai_count = 0;
    this._ai_error = 0;
    this._ai_correct = 0;
    this._range = 0;
    this._day = 0;
    this._prestige = 0;
    this._prestigeLv = 0;
    this._go_guajitele = false;
    this._oldexp = 0L;
    this._isItemName = false;
    this._isItemopen = false;
    this._isfollow = false;
    this._isfollowcheck = false;
    this.guaji_poly = 0;
    this._hateList = new L1HateList();
    this._firstAttack = false;
    this._pcMove = null;
    this.move = 0;
    this._aiRunning = false;
    this._actived = false;
    this._Pathfinding = false;
    this._randomMoveDirection = 0;
    this._tguajiX = 0;
    this._tguajiY = 0;
    this._guajiMapId = 0;
    this._armorbreaklevel = 0;
    this._soulHp_r = 0;
    this._soulHp_hpmin = 0;
    this._soulHp_hpmax = 0;
    this.isSoulHp = 0;
    this.soulHp = new ArrayList<>();
    this._PVPdmgg = 0;
    this._weaponSkillChance = 0;
    this._addWeaponSkillDmg = 0.0D;
    this._newcharpra = false;
    this._lslocx = 0;
    this._lslocy = 0;
    this._opengfxid = true;
    this.ValakasStatus = 0;
    this._followmebuff = false;
    this._ItemBlendcheckitem = 0;
    this._ItemBlendcheckitemcount = 0;
    this._hppotion = 0;
    this._pvp = 0;
    this._bowpvp = 0;
    this._followxy1 = 1;
    this._polyarrow = 66;
    this._changtype1 = 0;
    this._changtype2 = 0;
    this._changtype3 = 0;
    this._changtype4 = 0;
    this._changtype5 = 0;
    this._pag = 0;
    this._keyenemy = false;
    this._outenemy = false;
    this._enemyteleport = false;
    this._attackteleport = false;
    this._autobuff = new ArrayList<>();
    this._autoattack = new ArrayList<>();
    this._buffskill = false;
    this._attackskill = false;
    this._go_guajired = false;
    this._ma1 = 50;
    this._npcdmg = 0.0D;
    this._newai1 = 0;
    this._newai2 = 0;
    this._newai3 = 0;
    this._newai4 = 0;
    this._newai5 = 0;
    this._newai6 = 0;
    this._newaiq1 = 0;
    this._newaiq2 = 0;
    this._newaiq3 = 0;
    this._newaiq4 = 0;
    this._newaiq5 = 0;
    this._newaiq6 = 0;
    this._newaiq7 = 0;
    this._newaiq8 = 0;
    this._newaiq9 = 0;
    this._newaiq0 = 0;
    this._npciddmg = 0;
    this._followatk = false;
    this._followatkmagic = false;
    this._isfollowskill26 = false;
    this._isfollowskill42 = false;
    this._isfollowskill55 = false;
    this._isfollowskill68 = false;
    this._isfollowskill160 = false;
    this._isfollowskill79 = false;
    this._isfollowskill148 = false;
    this._isfollowskill151 = false;
    this._isfollowskill149 = false;
    this._isfollowskill158 = false;
    this._isnomoveguaji = false;
    this._Badkeyenemy = false;
    this._Badoutenemy = false;
    this._oldMapId = 0;
    this._ischeckpoly = false;
    this._isOutbur = false;
    this._ischeckOutbur = false;
    this._WeaponTotalDmg = 0;
    this._WeaponSkillPro = 0;
    this._PcMagicPro = 0;
    this._Save_Quest_Map1 = 0;
    this._Save_Quest_Map2 = 0;
    this._Save_Quest_Map3 = 0;
    this._Save_Quest_Map4 = 0;
    this._Save_Quest_Map5 = 0;
    this._CardId = 0;
    this.soulTower = 0;
    this._isarmor_setgive = false;
    this._summon_skillid = 0;
    this._summon_skillidmp = 0;
    this._checksummid = false;
    this._checksummidhp = false;
    this._mobatk = false;
    this._TRIPLEARROW = false;
    this._accessLevel = 0;
    this._currentWeapon = 0;
    this._inventory = new L1PcInventory(this);
    this._dwarf = new L1DwarfInventory(this);
    this._dwarfForCha = new L1DwarfForChaInventory(this);
    this._dwarfForElf = new L1DwarfForElfInventory(this);
    this._tradewindow = new L1Inventory();
    this._quest = new L1PcQuest(this);
    this._action = new L1ActionPc(this);
    this._actionPet = new L1ActionPet(this);
    this._actionSummon = new L1ActionSummon(this);
    this._equipSlot = new L1EquipmentSlot(this);
    LocalDateTime localNow = LocalDateTime.now();
    this.lastTimeAttackTime = localNow;
    this.lastTimeMoveTime = localNow;
    this.lastTimeSpellDirTime = localNow;
    this.lastTimeSpellNoirTime = localNow;
  }
  
  public int get_backpage() {
    return this._backpage;
  }
  
  public void set_backpage(int _backpage) {
    this._backpage = _backpage;
  }
  
  private int _fearlevel = 0;
  
  public void add_FearLevel(int add)
  {
    this._fearlevel += add;
  }

  public int get_FearLevel()
  {
    return this._fearlevel;
  }
  
	private int _yes_no;

	public int getYes_No() {
		return _yes_no;
	}

	public void setYes_No(int b) {
		_yes_no = b;
	}
}
